dotfiles/scripts/toggle-waybar.bash
2025-05-20 10:59:19 +01:00

15 lines
284 B
Bash

cd ~/Code/dotfiles/scripts
waybar_status=$(ps -a | rg "waybar" | awk '{print $1}')
if [ -z $waybar_status ]; then
# Waybar not found. Let's toggle it
echo "Starting"
waybar &
else
# Waybar found, lets close it.
echo "Killing"
echo $(kill $waybar_status)
fi