dotfiles/unprocessed/config/polybar/launch.sh

29 lines
686 B
Bash
Raw Permalink Normal View History

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
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
export display=$display
if [ "$display" == "$primary" ]
then
bar="primary"
else
bar="secondary"
fi
2021-06-11 21:43:46 +02:00
polybar -q $bar -c ~/.config/polybar/config.ini &
2017-07-02 22:06:24 +02:00
done
echo "Bars launched..."