From 80ab172c62911710ea9afdee9f703f0b83658f42 Mon Sep 17 00:00:00 2001 From: adam <56338480+adastx@users.noreply.github.com> Date: Sun, 9 Oct 2022 13:52:53 +0200 Subject: scripts: fixed 'barpos' grep --- .local/bin/barpos | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to '.local/bin/barpos') 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 "$@" -- cgit v1.2.3-70-g09d2