Fix monitor problems

Signed-off-by: Severin Kaderli <severin@kaderli.dev>
This commit is contained in:
Severin Kaderli 2019-06-06 21:31:12 +02:00
parent 92c15e04d0
commit be92d7f1b3
Signed by: severinkaderli
GPG key ID: F419F8835B72F0C4
12 changed files with 149 additions and 128 deletions

View file

@ -0,0 +1,44 @@
#!/usr/bin/env bash
#
# SCRIPT NAME:
# polybar-launch
#
# AUTHOR:
# Severin Kaderli <severin@kaderli.dev>
#
# DESCRIPTION:
# This script kills existing polybar processes and then launches the bars.
#
# USAGE:
# ./polybar-launch
# 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
if [ "${IS_WORK}" = "1" ]; then
export POLYBAR_BATTERY="BAT1"
export POLYBAR_WLAN="wlp4s0"
export POLYBAR_NETWORK="enp0s31f6"
else
export POLYBAR_BATTERY="BAT0"
export POLYBAR_WLAN="wlp3s0"
export POLYBAR_NETWORK="enp0s31f6"
fi
MONITORS=(
"eDP1"
"eDP-1-1"
"HDMI1"
"HDMI-1-1"
"DVI-I-1-1"
"DVI-I-2-1"
)
for monitor in "${MONITORS[@]}"; do
export POLYBAR_MONITOR="${monitor}"
polybar top &
polybar bottom &
done