mirror of
https://github.com/fscotto/infra.git
synced 2026-05-30 23:49:56 +00:00
desktop: add polybar dotfiles
This commit is contained in:
20
dotfiles/desktop/.config/polybar/launch.sh
Normal file
20
dotfiles/desktop/.config/polybar/launch.sh
Normal file
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
# Restart polybar on each connected monitor.
|
||||
|
||||
polybar-msg cmd quit >/dev/null 2>&1 || true
|
||||
|
||||
while pgrep -u "$UID" -x polybar >/dev/null; do
|
||||
sleep 0.1
|
||||
done
|
||||
|
||||
if command -v xrandr >/dev/null 2>&1; then
|
||||
monitors=$(xrandr --query | awk '/ connected/ {print $1}')
|
||||
fi
|
||||
|
||||
if [ -n "${monitors:-}" ]; then
|
||||
for m in $monitors; do
|
||||
MONITOR="$m" polybar main >/dev/null 2>&1 &
|
||||
done
|
||||
else
|
||||
polybar main >/dev/null 2>&1 &
|
||||
fi
|
||||
Reference in New Issue
Block a user