multi monitor support; auto reload config
This commit is contained in:
@@ -10,7 +10,7 @@ secondary = #fff
|
|||||||
alert = #f00
|
alert = #f00
|
||||||
|
|
||||||
[bar/main]
|
[bar/main]
|
||||||
monitor = eDP1
|
monitor = ${env:MONITOR}
|
||||||
bottom = false
|
bottom = false
|
||||||
fixed-center = true
|
fixed-center = true
|
||||||
width = 100%
|
width = 100%
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# Terminate already running bar instances
|
# if there is no running instance
|
||||||
killall -q polybar
|
if ! pgrep -ax polybar >/dev/null 2>&1; then
|
||||||
|
# launch Polybar on every monitor
|
||||||
# Wait until the processes have been shut down
|
# https://github.com/polybar/polybar/issues/763#issuecomment-392960721
|
||||||
while pgrep -x polybar >/dev/null; do sleep 1; done
|
for m in $(polybar --list-monitors | cut -d':' -f1); do
|
||||||
|
MONITOR=$m polybar --reload -c "$HOME/.config/polybar/config" main &
|
||||||
# Launch Polybar
|
done
|
||||||
polybar -c "$HOME/.config/polybar/config" main &
|
|
||||||
|
|
||||||
echo "Polybar launched..."
|
echo "Polybar launched..."
|
||||||
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user