diff options
author | adam <56338480+adastx@users.noreply.github.com> | 2022-11-08 16:29:27 +0100 |
---|---|---|
committer | adam <56338480+adastx@users.noreply.github.com> | 2022-11-08 16:29:27 +0100 |
commit | f734b5a441a15ef55c7d28f0007f0cca36a57191 (patch) | |
tree | d23662c8dddf556478acf130dfe538754577750f | |
parent | 388eb084f0187ac9dc135a52f4cdfe78f984ba34 (diff) |
scripts: minor cleanup
-rwxr-xr-x | .local/bin/barpos | 8 | ||||
-rwxr-xr-x | .local/bin/pashare | 5 |
2 files changed, 7 insertions, 6 deletions
diff --git a/.local/bin/barpos b/.local/bin/barpos index d84709d..66f29de 100755 --- a/.local/bin/barpos +++ b/.local/bin/barpos @@ -3,7 +3,7 @@ BAR_CFG="$XDG_CONFIG_HOME/polybar/config.ini" main () { - if [ ! -n "$1" ]; then + if [ -z "$1" ]; then toggle ; exit 0 fi @@ -18,7 +18,7 @@ main () { } toggle () { - if grep -Eq "^bottom = true$" $BAR_CFG; then + if grep -Eq "^bottom = true$" "$BAR_CFG"; then top else bottom @@ -26,11 +26,11 @@ toggle () { } bottom () { - sed -Ei "s|^bottom = .*$|bottom = true|" $BAR_CFG + sed -Ei "s|^bottom = .*$|bottom = true|" "$BAR_CFG" } top () { - sed -Ei "s|^bottom = .*$|bottom = false|" $BAR_CFG + sed -Ei "s|^bottom = .*$|bottom = false|" "$BAR_CFG" } main "$@" diff --git a/.local/bin/pashare b/.local/bin/pashare index 0e6d885..8ce0170 100755 --- a/.local/bin/pashare +++ b/.local/bin/pashare @@ -17,7 +17,7 @@ main () { start () { stop >/dev/null 2>&1 - DEST=$(cat $XDG_CONFIG_HOME/pashare/dest) + DEST=$(cat "$XDG_CONFIG_HOME/pashare/dest") pactl load-module module-null-sink \ sink_name=rtp \ @@ -26,7 +26,8 @@ start () { channels=2 \ rate=48000 >/dev/null - pactl load-module module-rtp-send source=rtp.monitor destination=$DEST port=4010 mtu=320 >/dev/null + pactl load-module module-rtp-send source=rtp.monitor destination="$DEST" \ + port=4010 mtu=320 >/dev/null } stop () { |