aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2021-08-28 15:06:00 +0200
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2021-08-28 15:06:00 +0200
commit333679134590662347c4f5dd5ba6ee68472e4565 (patch)
tree6f3b932975652e442334e60d3ae4590154558c29 /scripts
parenteacc39d064178bb03b0991ad7632e6b483db2780 (diff)
downloaddotfiles-333679134590662347c4f5dd5ba6ee68472e4565.tar.gz
polybar
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/launch_polybar.sh14
1 files changed, 10 insertions, 4 deletions
diff --git a/scripts/launch_polybar.sh b/scripts/launch_polybar.sh
index a72da57..a340d93 100755
--- a/scripts/launch_polybar.sh
+++ b/scripts/launch_polybar.sh
@@ -1,7 +1,13 @@
#!/bin/bash
-killall polybar
+killall polybar > /dev/null 2>&1
-for m in $(polybar --list-monitors | cut -d":" -f1); do
- MONITOR=$m polybar --reload jonny &
-done
+while read -r MON RES PRIM; do
+ if [ -n "$PRIM" ]; then
+ BAR=main
+ else
+ BAR=secondary
+ fi
+
+ MONITOR=$MON polybar --reload $BAR &
+done <<< "$(polybar --list-monitors | tr -d ':')"