scripts/waybar/toggle.sh

33 lines
907 B
Bash
Raw Normal View History

#!/bin/bash
ARG=$1
if [[ $ARG == '' ]]; then
2023-01-06 19:41:31 +00:00
ARG="toggle"
fi
if [[ $ARG == 'toggle' ]]; then
2023-01-06 19:41:31 +00:00
if [[ -e '/home/jpm/.config/waybar/.hidden' ]]; then
rm '/home/jpm/.config/waybar/.hidden';
else
touch '/home/jpm/.config/waybar/.hidden';
fi
elif [[ $ARG == 'hide' ]]; then
2023-01-06 19:41:31 +00:00
if [[ ! -e '/home/jpm/.config/waybar/.hidden' ]]; then
touch '/home/jpm/.config/waybar/.hidden';
else
echo 'Already hidden. You may need to use the "invert" option if action is reversed';
exit;
fi
elif [[ $ARG == 'show' ]]; then
2023-01-06 19:41:31 +00:00
if [[ -e '/home/jpm/.config/waybar/.hidden' ]]; then
rm '/home/jpm/.config/waybar/.hidden';
else
echo 'Already shown. You may need to use the "invert" option if action is reversed';
exit;
fi
elif [[ $ARG != 'invert' ]]; then
2023-01-06 19:41:31 +00:00
echo "Invalid argument";
fi
/home/jpm/scripts/waybar/toggle `pgrep waybar`