blob: 38cf198b0ad59bf437d55e206da42ea7bb8fd73e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
#!/bin/bash
## Add this to your wm startup file.
# Terminate already running bar instances
killall -q polybar
# Wait until the processes have been shut down
while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done
# Get network Interface
export DEFAULT_NETWORK_INTERFACE=$(ip route | grep '^default' | awk '{print $5}' | head -n1)
# Load on second monitor if connected
external_monitor=$(xrandr --query | grep 'DP-1')
if [[ $external_monitor = DP-1\ connected* ]]; then
polybar -c ~/.config/polybar/config.ini secondary &
fi
## Load bar on primary monitor
polybar -c ~/.config/polybar/config.ini main &
|