dotfiles/system/.local/bin/polybar-launch
Severin Kaderli 6708822de7
Update battery module for polybar
Signed-off-by: Severin Kaderli <severin@kaderli.dev>
2019-07-16 13:44:23 +02:00

44 lines
No EOL
858 B
Bash
Executable file

#!/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_WLAN="wlp4s0"
export POLYBAR_NETWORK="enp0s20f0u1u1i5"
else
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
if is-connected "${monitor}"; then
export POLYBAR_MONITOR="${monitor}"
polybar top &
polybar bottom &
fi
done