mirror of
https://github.com/vincentbernat/i3wm-configuration.git
synced 2025-06-23 02:08:35 +02:00
polybar: make it compatible with RandR monitors
Other uses of RandR do not need to be aware of monitors. Wallpapers could be, but it works just fine without that.
This commit is contained in:
parent
325d7778d7
commit
7ed896496f
1 changed files with 2 additions and 2 deletions
|
@ -3,8 +3,8 @@
|
|||
export DPI=$(xrdb -query | sed -nE 's/^Xft\.dpi:\s*//p')
|
||||
export HEIGHT=$((20 * DPI / 96))
|
||||
|
||||
MONITORS=$(xrandr --current | awk '($0 ~ / connected / && $0 ~ / [0-9]+x[0-9]+\+/) {print $1}')
|
||||
PRIMARY=$(xrandr --current | awk '($0 ~ / connected primary / && $0 ~ / [0-9]+x[0-9]+\+/) {print $1; exit}')
|
||||
MONITORS=$(xrandr --current --listactivemonitors | sed -nE 's/ *([0-9]+): [+*]*([^ ]*).*/\2/p')
|
||||
PRIMARY=$(xrandr --current --listactivemonitors | sed -nE 's/ *([0-9]+): [+]?[*]([^ ]*).*/\2/p')
|
||||
PRIMARY=${PRIMARY:-${MONITORS%% *}}
|
||||
|
||||
case $(echo $MONITORS | wc -w) in
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue