Created
June 7, 2023 06:48
-
-
Save tuannv1807/8348decbfd7494bda83c76fc29ea843e to your computer and use it in GitHub Desktop.
Polybar launcher multiple screens
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
# Terminate already running bar instances | |
killall -q polybar | |
# Wait until the processes have been shut down | |
while pidof polybar >/dev/null; do sleep 1; done | |
if type "xrandr"; then | |
for m in $(xrandr --query | grep " connected" | cut -d" " -f1); do | |
MONITOR=$m polybar --reload main & | |
done | |
else | |
polybar --reload main & | |
fi | |
echo "Bars launched..." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment