mirror of
https://github.com/vincentbernat/i3wm-configuration.git
synced 2025-07-10 18:24:22 +02:00
polybar: only takes the primary screen if connected
This commit is contained in:
parent
1ee8138fbf
commit
ce25d4d970
1 changed files with 2 additions and 1 deletions
|
@ -4,7 +4,8 @@ export DPI=$(xrdb -query | sed -nE 's/^Xft\.dpi:\s*//p')
|
||||||
export HEIGHT=$((20 * DPI / 96))
|
export HEIGHT=$((20 * DPI / 96))
|
||||||
|
|
||||||
MONITORS=$(xrandr --current | awk '($0 ~ / connected / && $0 ~ / [0-9]+x[0-9]+\+/) {print $1}')
|
MONITORS=$(xrandr --current | awk '($0 ~ / connected / && $0 ~ / [0-9]+x[0-9]+\+/) {print $1}')
|
||||||
PRIMARY=$(xrandr --current | awk '($0 ~ / primary /) {print $1; exit}')
|
PRIMARY=$(xrandr --current | awk '($0 ~ / connected primary / && $0 ~ / [0-9]+x[0-9]+\+/) {print $1; exit}')
|
||||||
|
PRIMARY=${PRIMARY:-${MONITORS%% *}}
|
||||||
NUMS=$(echo $MONITORS | wc -w)
|
NUMS=$(echo $MONITORS | wc -w)
|
||||||
case $NUMS in
|
case $NUMS in
|
||||||
1)
|
1)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue