diff options
Diffstat (limited to '.local/bin/barpos')
-rwxr-xr-x | .local/bin/barpos | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/.local/bin/barpos b/.local/bin/barpos deleted file mode 100755 index 66f29de..0000000 --- a/.local/bin/barpos +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh - -BAR_CFG="$XDG_CONFIG_HOME/polybar/config.ini" - -main () { - if [ -z "$1" ]; then - toggle ; exit 0 - fi - - case "$1" in - t|top) - top ;; - b|bottom) - bottom ;; - *) - echo "usage: barpos [top|bottom]" ;; - esac -} - -toggle () { - if grep -Eq "^bottom = true$" "$BAR_CFG"; then - top - else - bottom - fi -} - -bottom () { - sed -Ei "s|^bottom = .*$|bottom = true|" "$BAR_CFG" -} - -top () { - sed -Ei "s|^bottom = .*$|bottom = false|" "$BAR_CFG" -} - -main "$@" |