Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save tuannv1807/8348decbfd7494bda83c76fc29ea843e to your computer and use it in GitHub Desktop.
Save tuannv1807/8348decbfd7494bda83c76fc29ea843e to your computer and use it in GitHub Desktop.
Polybar launcher multiple screens
#!/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