TheRepoClub-DotFiles/autorandr/.config/autorandr/postswitch
2022-08-14 12:14:49 +01:00

21 lines
559 B
Bash
Executable File

#!/usr/bin/env bash
WM=$(wmctrl -m | grep Name | cut -d: -f2)
WM=${WM//[[:space:]]/}
if [ "$WM" == "i3" ]; then
if ! command -v polybar &>/dev/null; then
echo "polybar could not be found"
else
if ! pgrep -x "polybar" >/dev/null; then
if ! test -f "$HOME/.config/polybar/launch.sh"; then
echo "$HOME/.config/polybar/launch.sh could not be found"
else
sh $HOME/.config/polybar/launch.sh
fi
else
echo "polybar already Running"
fi
fi
fi