summaryrefslogtreecommitdiff
path: root/.local/bin
diff options
context:
space:
mode:
authoradam <56338480+adastx@users.noreply.github.com>2022-10-07 00:16:45 +0200
committeradam <56338480+adastx@users.noreply.github.com>2022-10-07 00:16:45 +0200
commita3ec6663fd64d7dac3090d63924cc9e1d211dd41 (patch)
tree4069c5991bedee77bcaf099074dedb0a6695751e /.local/bin
parent57e93c8ae935e8d3a7e8140ab14d44b108a53d8f (diff)
script: barpos - toggle polybar position top/bottom
Diffstat (limited to '.local/bin')
-rwxr-xr-x.local/bin/barpos14
1 files changed, 14 insertions, 0 deletions
diff --git a/.local/bin/barpos b/.local/bin/barpos
new file mode 100755
index 0000000..deb3840
--- /dev/null
+++ b/.local/bin/barpos
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+polybar_cfg=$XDG_CONFIG_HOME/polybar/config.ini
+
+bottom_str="bottom = true"
+top_str="bottom = false"
+
+if grep -q "$bottom_str" $polybar_cfg; then
+ sed -i "s/$bottom_str/$top_str/" $polybar_cfg
+else
+ sed -i "s/$top_str/$bottom_str/" $polybar_cfg
+fi
+
+polybar-launch