diff options
author | adam <56338480+adastx@users.noreply.github.com> | 2022-10-09 13:52:53 +0200 |
---|---|---|
committer | adam <56338480+adastx@users.noreply.github.com> | 2022-10-09 13:52:53 +0200 |
commit | 80ab172c62911710ea9afdee9f703f0b83658f42 (patch) | |
tree | c3daafc4c5e057ca2520ef11b634fddddc1175ec /.local/bin | |
parent | 4c3f73f8c034741693288dd830c5e65d7f3d125a (diff) |
scripts: fixed 'barpos' grep
Diffstat (limited to '.local/bin')
-rwxr-xr-x | .local/bin/barpos | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/.local/bin/barpos b/.local/bin/barpos index 840b839..6caf44d 100755 --- a/.local/bin/barpos +++ b/.local/bin/barpos @@ -41,19 +41,19 @@ help () { } toggle () { - if grep -q "$BOTTOM" $BAR_CFG; then - sed -i "s/$BOTTOM/$TOP/" $BAR_CFG + if grep -Eq "^$BOTTOM$" $BAR_CFG; then + top else - sed -i "s/$TOP/$BOTTOM/" $BAR_CFG + bottom fi } bottom () { - sed -ir "s/bottom = .*$/bottom = true/" $BAR_CFG + sed -ir "s|^bottom = .*$|bottom = true|" $BAR_CFG } top () { - sed -ir "s/bottom = .*$/bottom = false/" $BAR_CFG + sed -ir "s|^bottom = .*$|bottom = false|" $BAR_CFG } main "$@" |