From d1067cbb0030a339bcfce855c93383dc9a882227 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=20Fernando=20S=C3=A1nchez?= Date: Mon, 28 Dec 2020 14:58:13 +0100 Subject: [PATCH] Fix polybar.sh After the last update, I started getting duplicated bars when using cloned monitors. This commit changes the polybar.sh script to use replace xrandr with a call to `polybar --list-monitors`, which ignores cloned monitors by default. --- scripts/.bin/polybar.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/scripts/.bin/polybar.sh b/scripts/.bin/polybar.sh index 5fa0ff8..1d2adc7 100755 --- a/scripts/.bin/polybar.sh +++ b/scripts/.bin/polybar.sh @@ -6,10 +6,8 @@ killall -q polybar # Wait until the processes have been shut down while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done -if type "xrandr"; then - for m in $(xrandr --query | grep " connected" | cut -d" " -f1); do - MONITOR=$m polybar --reload main & - done -else +for m in $(polybar --list-monitors | cut -d":" -f1); do + MONITOR=$m polybar --reload main & +done polybar --reload main & fi