1
0
forked from extern/nix-config

polybar: Don't hardcode monitor to display on

Now polybar will show on all monitors by default, and we don't have to
update the script every time those monitors change, useful when changing
between computers that use HDMI and computers that use display port, for
example.
This commit is contained in:
Donovan Glover 2022-04-11 09:57:47 -04:00
parent cc9b8aed08
commit 80bfb36919
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65
2 changed files with 5 additions and 3 deletions

View File

@ -17,7 +17,7 @@ modules-left = bspwm
modules-center = window
modules-right = cpu ram volume wifi date time battery
monitor = eDP
monitor = ${env:MONITOR:}
wm-restack = bspwm
include-file = $HOME/.cache/polybar/config

View File

@ -52,5 +52,7 @@ echo $BSPWM_TOP_PADDING > $HOME/.cache/polybar/bspwm_top_padding
# Wait until there are no more polybar instances running
while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done
# Start polybar
polybar main &
# Start polybar programmatically on all monitors by default
for m in $(polybar --list-monitors | cut -d":" -f1); do
MONITOR=$m polybar main &
done