Add .local/bin/fishify_envs
Add .local/bin/hyprtoggle Add .local/bin/localhost Add .local/bin/tmux-sessionizer
This commit is contained in:
parent
5b3b5d0730
commit
289efb7172
4 changed files with 127 additions and 0 deletions
20
private_dot_local/bin/executable_fishify_envs
Normal file
20
private_dot_local/bin/executable_fishify_envs
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
in="$1"
|
||||
|
||||
if [[ -z "$in" ]]; then
|
||||
echo "usage: $0 input_file"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
while IFS= read -r line; do
|
||||
[[ -z "$line" || "$line" =~ ^# ]] && continue
|
||||
if [[ "$line" =~ ^([A-Za-z_][A-Za-z0-9_]*)=(.*)$ ]]; then
|
||||
var="${BASH_REMATCH[1]}"
|
||||
val="${BASH_REMATCH[2]}"
|
||||
val="${val%\"}"
|
||||
val="${val#\"}"
|
||||
echo "set -Ux $var \"$val\""
|
||||
fi
|
||||
done < "$in"
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue