From a3ec6663fd64d7dac3090d63924cc9e1d211dd41 Mon Sep 17 00:00:00 2001 From: adam <56338480+adastx@users.noreply.github.com> Date: Fri, 7 Oct 2022 00:16:45 +0200 Subject: script: barpos - toggle polybar position top/bottom --- .local/bin/barpos | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 .local/bin/barpos (limited to '.local/bin/barpos') 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 -- cgit v1.2.3-70-g09d2