2021-07-04 18:25:28 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
export DPI=$(xrdb -query | sed -nE 's/^Xft\.dpi:\s*//p')
|
2021-08-07 21:09:10 +02:00
|
|
|
export HEIGHT=$((18 * DPI / 96))
|
2021-07-04 18:25:28 +02:00
|
|
|
|
2021-08-14 20:51:29 +02:00
|
|
|
MONITORS=$(polybar --list-monitors | sed -nE 's/([^ ]+): .*/\1/p' | tr '\n' ' ')
|
|
|
|
PRIMARY=$(polybar --list-monitors | grep -F '(primary)' | sed -nE 's/([^ ]+): .*/\1/p')
|
2021-07-15 19:12:36 +02:00
|
|
|
PRIMARY=${PRIMARY:-${MONITORS%% *}}
|
2021-07-15 20:52:32 +02:00
|
|
|
|
2021-08-02 22:59:26 +02:00
|
|
|
awk 'BEGIN { i=0 } ($4 == "/" && $3 !~ /^0:/) {print "mount-"i" = "$5; i++}' /proc/self/mountinfo \
|
|
|
|
> $XDG_RUNTIME_DIR/i3/polybar-filesystems.conf
|
|
|
|
|
2021-07-15 20:52:32 +02:00
|
|
|
case $(echo $MONITORS | wc -w) in
|
2021-07-08 08:10:37 +02:00
|
|
|
1)
|
2021-07-17 11:09:04 +02:00
|
|
|
MONITOR=$PRIMARY polybar --reload alone &
|
2021-07-08 08:10:37 +02:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
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
|