2020-06-21 10:41:26 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2020-08-18 22:25:19 +00:00
|
|
|
pkill polybar
|
2020-06-21 10:41:26 +00:00
|
|
|
echo "---" | tee -a /tmp/polybar1.log /tmp/polybar2.log
|
|
|
|
|
|
|
|
|
|
|
|
outputs=$(xrandr --query | grep " connected" | cut -d" " -f1)
|
|
|
|
tray_output=HDMI-A-0
|
|
|
|
for m in $outputs; do
|
2021-01-31 10:55:50 +00:00
|
|
|
if [[ $m != "DP-1" ]]; then
|
2020-06-21 10:41:26 +00:00
|
|
|
tray_output=$m
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
for m in $outputs; do
|
|
|
|
export MONITOR=$m
|
|
|
|
export TRAY_POSITION=none
|
|
|
|
if [[ $m == "$tray_output" ]]; then
|
|
|
|
TRAY_POSITION=right
|
|
|
|
fi
|
|
|
|
MONITOR=$m polybar -r --config=/home/leon/.config/polybar/config.ini main & # >>/tmp/polybar1.log 2>&1 &
|
|
|
|
done
|
|
|
|
|
|
|
|
#polybar --config=/home/leon/.config/polybar/config.ini main >>/tmp/polybar1.log 2>&1 &
|