polybar.sh 349 B

12345678910111213
  1. #!/usr/bin/env bash
  2. set -euo pipefail # bash strict mode
  3. # Terminate already running bar instances
  4. killall -q polybar
  5. # Wait until the processes have been shut down
  6. while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done
  7. # Launch Polybar, using default config location ~/.config/polybar/config
  8. polybar -r example &
  9. echo "Polybar launched..."