diff --git a/bin/polybar b/bin/polybar index 36c8832..4a802d4 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=$(xrandr --current --listactivemonitors | sed -nE 's/ *([0-9]+): [+*]*([^ ]*).*/\2/p') -PRIMARY=$(xrandr --current --listactivemonitors | sed -nE 's/ *([0-9]+): [+]?[*]([^ ]*).*/\2/p') +MONITORS=$(polybar --list-monitors | sed -nE 's/([^ ]+): .*/\1/p') +PRIMARY=$(polybar --list-monitors | grep -F '(primary)' | sed -nE 's/([^ ]+): .*/\1/p') PRIMARY=${PRIMARY:-${MONITORS%% *}} awk 'BEGIN { i=0 } ($4 == "/" && $3 !~ /^0:/) {print "mount-"i" = "$5; i++}' /proc/self/mountinfo \