This commit is contained in:
danijoo
2020-09-25 10:01:02 +02:00
parent e028095def
commit 88baca7458
6 changed files with 47 additions and 38 deletions

View File

@@ -6,12 +6,19 @@ include-file = ~/.config/polybar/config.d/base_bar
[bar/laptop]
inherit = bar/base
monitor = ${env:MONITOR:eDP-1}
monitor = ${env:MONITOR:}
modules-left = i3 xwindow
modules-right = previous playpause next spotify pulseaudio cpu memory battery1 date
tray-position = right
tray-padding = 2
[bar/laptop_extern]
inherit = bar/laptop
monitor = ${env:MONITOR:HDMI-2}
[bar/laptop_secondary]
inherit = bar/base
monitor = ${env:MONITOR:}
modules-left = i3 xwindow
modules-right = previous playpause next spotify pulseaudio cpu memory battery1 date
tray-position = none

View File

@@ -5,8 +5,19 @@ killall -q polybar
# Wait until the processes have been shut down
while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done
# Launch bar1 and bar2
polybar -c ~/.config/polybar/config laptop &
polybar -c ~/.config/polybar/config laptop_extern &
if type "xrandr"; then
# primary screen
for m in $(xrandr --query | grep " connected" | grep "primary" | cut -d" " -f1); do
MONITOR=$m polybar --reload laptop &
done
# other screens
for m in $(xrandr --query | grep " connected" | grep -v "primary" | cut -d" " -f1); do
MONITOR=$m polybar --reload laptop_secondary &
done
else
polybar --reload laptop &
fi
# polybar -c ~/.config/polybar/config laptop &
# polybar -c ~/.config/polybar/config laptop_extern &
echo "Bars launched..."