Made polybar more extensible

This commit is contained in:
Vlad Doster 2020-01-04 23:57:26 -05:00
parent bebf718131
commit b9d295d45c
2 changed files with 8 additions and 2 deletions

View File

@ -21,7 +21,7 @@ background = #1d2021
foreground = #ebdbb2
[bar/main]
monitor = ${env:MONITOR:eDP-1-1}
monitor = ${env:MONITOR:}
enable-ipc = true
width = 100%
height = 20

View File

@ -3,6 +3,12 @@
# Terminate already running bar instances
killall -q polybar
for i in $(polybar -m | awk -F: '{print $1}'); do MONITOR=$i polybar main & done
if type "xrandr"; then
for m in $(xrandr --query | grep " connected" | cut -d" " -f1); do
MONITOR=$m polybar --reload main &
done
else
polybar --reload main &
fi
echo "Bars launched..."