2021-07-04 18:25:28 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
export DPI=$(xrdb -query | sed -nE 's/^Xft\.dpi:\s*//p')
|
|
|
|
export HEIGHT=$((20 * DPI / 96))
|
|
|
|
|
2021-07-15 14:32:00 +02:00
|
|
|
MONITORS=$(xrandr --current | awk '($0 ~ / connected / && $0 ~ / [0-9]+x[0-9]+\+/) {print $1}')
|
|
|
|
PRIMARY=$(xrandr --current | awk '($0 ~ / primary /) {print $1; exit}')
|
|
|
|
NUMS=$(echo $MONITORS | wc -w)
|
2021-07-08 08:10:37 +02:00
|
|
|
case $NUMS in
|
|
|
|
1)
|
|
|
|
MONITOR=$PRIMARY polybar --reload alone &
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
MONITOR=$PRIMARY polybar --reload primary &
|
2021-07-15 14:32:00 +02:00
|
|
|
for MONITOR in ${MONITORS}; do
|
|
|
|
[ $MONITOR != $PRIMARY ] || continue
|
|
|
|
MONITOR=$MONITOR polybar --reload secondary &
|
2021-07-08 08:10:37 +02:00
|
|
|
done
|
|
|
|
;;
|
|
|
|
esac
|
2021-07-04 18:25:28 +02:00
|
|
|
wait
|