From f822276f68d09cfaf4f71db9dfdbdbf7ea93d649 Mon Sep 17 00:00:00 2001 From: Niklas Date: Thu, 9 Jul 2020 13:17:17 +0200 Subject: [PATCH] foxed monitor for polybar --- .config/polybar/config | 4 +--- .config/polybar/launch.sh | 9 +++++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.config/polybar/config b/.config/polybar/config index 85af622..593e559 100755 --- a/.config/polybar/config +++ b/.config/polybar/config @@ -22,9 +22,7 @@ alert = #bd2c40 [bar/main] enable-ipc = true -#monitor = ${env:MONITOR:LVDS-1} -MONITOR=$(polybar -m|tail -1|sed -e 's/:.*$//g') -monitor-fallback = ${env:MONITOR:LVDS-1} +monitor = ${env:MONITOR} width = 100% height = 25 ;offset-x = 1% diff --git a/.config/polybar/launch.sh b/.config/polybar/launch.sh index d1590f3..54ba767 100755 --- a/.config/polybar/launch.sh +++ b/.config/polybar/launch.sh @@ -7,7 +7,12 @@ killall -q polybar while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done # Launch bar1 and bar2 -polybar main & - +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..."