aboutsummaryrefslogtreecommitdiff
path: root/linux/home/.config/polybar/launch.sh
diff options
context:
space:
mode:
authorsrdusr <trevorgray@srdusr.com>2025-08-30 19:22:59 +0200
committersrdusr <trevorgray@srdusr.com>2025-08-30 19:22:59 +0200
commit19120d4f9761c67d99ed1ce3da6084b83f5a49c9 (patch)
treef234cad1bdad88114a63c9702144da487024967a /linux/home/.config/polybar/launch.sh
parent5928998af5404ae2be84c6cecc10ebf84bd3f3ed (diff)
downloaddotfiles-19120d4f9761c67d99ed1ce3da6084b83f5a49c9.tar.gz
dotfiles-19120d4f9761c67d99ed1ce3da6084b83f5a49c9.zip
Linux-specific dotfiles
Diffstat (limited to 'linux/home/.config/polybar/launch.sh')
-rwxr-xr-xlinux/home/.config/polybar/launch.sh31
1 files changed, 31 insertions, 0 deletions
diff --git a/linux/home/.config/polybar/launch.sh b/linux/home/.config/polybar/launch.sh
new file mode 100755
index 0000000..5468c8e
--- /dev/null
+++ b/linux/home/.config/polybar/launch.sh
@@ -0,0 +1,31 @@
+#!/usr/bin/env sh
+
+# Terminate already running bar instances
+killall -q polybar
+
+# Wait until the processes have been shut down
+while pgrep -u "$UID" -x polybar >/dev/null; do sleep 1; done
+
+
+# Launch bar
+#polybar main-0 &
+polybar main-1 &
+polybar main-2 &
+polybar main-3 &
+polybar main-4 &
+polybar main-5 &
+
+# Define bars per monitors
+#declare -A ARRANGEMENTS=(["$mainmonitor"]="main-0" ["$secondmonitor"]="main-0")
+declare -A ARRANGEMENTS=(["$mainmonitor"]="main-1,main-2,main-3,main-4,main-5" ["$secondmonitor"]="main-1,main-2,main-3,main-4,main-5")
+
+# Each key
+for MONITOR in "${!ARRANGEMENTS[@]}"; do
+ # split at `,` into array
+ while IFS=',' read -ra BARLIST; do
+ # for each bar (seperated by `,`) at current key
+ for BAR in "${BARLIST[@]}"; do
+ MONITOR="$MONITOR" polybar --reload "$BAR" &
+ done
+ done <<< "${ARRANGEMENTS[$MONITOR]}"
+done