2017-07-02 22:06:24 +02:00
|
|
|
#!/usr/bin/env sh
|
|
|
|
|
|
|
|
# Terminate already running bar instances
|
|
|
|
killall -q polybar
|
|
|
|
|
|
|
|
# Wait until the processes have been shut down
|
|
|
|
while pgrep -x polybar >/dev/null; do sleep 1; done
|
|
|
|
|
2017-07-10 06:53:24 +02:00
|
|
|
# Getting some vars
|
2017-07-06 21:53:33 +02:00
|
|
|
primary=$(xrandr | grep primary | head -1 | cut -d' ' -f1)
|
2017-07-10 06:53:24 +02:00
|
|
|
export ethI=$(/bin/ls /sys/class/net/ | grep ^enp* | head -1)
|
|
|
|
export wlanI=$(/bin/ls /sys/class/net/ | grep ^wl* | head -1)
|
|
|
|
|
|
|
|
# Launch bar for each display
|
2017-07-02 22:06:24 +02:00
|
|
|
polybar -m | cut -d':' -f1 | while read display
|
|
|
|
do
|
2017-07-06 21:53:33 +02:00
|
|
|
export display=$display
|
|
|
|
if [ "$display" == "$primary" ]
|
|
|
|
then
|
|
|
|
bar="primary"
|
|
|
|
else
|
|
|
|
bar="secondary"
|
|
|
|
fi
|
|
|
|
polybar $bar &
|
2017-07-02 22:06:24 +02:00
|
|
|
done
|
|
|
|
|
|
|
|
echo "Bars launched..."
|
|
|
|
|