From a5c608eff8839570557f7852aa7070ab4f2c12bd Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Mon, 16 Aug 2021 17:47:03 +0200 Subject: [PATCH] Revert "polybar: fix monitor detection on clone" This reverts commit 62a831ac40c2b68b82c374e96cf3a012bda8b9c3. --- bin/polybar | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/polybar b/bin/polybar index 4a802d4..8fc1b97 100755 --- a/bin/polybar +++ b/bin/polybar @@ -3,8 +3,8 @@ export DPI=$(xrdb -query | sed -nE 's/^Xft\.dpi:\s*//p') export HEIGHT=$((18 * DPI / 96)) -MONITORS=$(polybar --list-monitors | sed -nE 's/([^ ]+): .*/\1/p') -PRIMARY=$(polybar --list-monitors | grep -F '(primary)' | sed -nE 's/([^ ]+): .*/\1/p') +MONITORS=$(xrandr --current --listactivemonitors | sed -nE 's/ *([0-9]+): [+*]*([^ ]*).*/\2/p' | tr '\n' ' ') +PRIMARY=$(xrandr --current --listactivemonitors | sed -nE 's/ *([0-9]+): [+]?[*]([^ ]*).*/\2/p') PRIMARY=${PRIMARY:-${MONITORS%% *}} awk 'BEGIN { i=0 } ($4 == "/" && $3 !~ /^0:/) {print "mount-"i" = "$5; i++}' /proc/self/mountinfo \