summaryrefslogtreecommitdiff
path: root/.local/bin
diff options
context:
space:
mode:
authoradam <56338480+adastx@users.noreply.github.com>2022-10-09 13:52:53 +0200
committeradam <56338480+adastx@users.noreply.github.com>2022-10-09 13:52:53 +0200
commit80ab172c62911710ea9afdee9f703f0b83658f42 (patch)
treec3daafc4c5e057ca2520ef11b634fddddc1175ec /.local/bin
parent4c3f73f8c034741693288dd830c5e65d7f3d125a (diff)
scripts: fixed 'barpos' grep
Diffstat (limited to '.local/bin')
-rwxr-xr-x.local/bin/barpos10
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 "$@"