desktop: add polybar dotfiles

This commit is contained in:
Fabio Scotto di Santolo
2026-05-15 20:20:01 +02:00
parent dfa1bd194f
commit 0b3f5e4f0c
6 changed files with 270 additions and 18 deletions

View 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