summaryrefslogtreecommitdiff
path: root/.local
diff options
context:
space:
mode:
Diffstat (limited to '.local')
-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 "$@"