This commit is contained in:
2025-06-22 11:57:35 +02:00
parent 924caa2851
commit fbe156fa6c
7 changed files with 43 additions and 11 deletions

32
.scripts/waybar-toggle.sh Executable file
View File

@@ -0,0 +1,32 @@
#!/bin/env bash
function close() {
if pgrep -x "waybar" > /dev/null; then
killall -q waybar
# Wait until the processes have been shut down
while pgrep -x waybar >/dev/null; do sleep 1; done
fi
}
function open() {
waybar &
}
if [ -z "$1" ]; then
close
open
elif [ "$1" = "close" ]; then
if ! pgrep -x "waybar" > /dev/null; then
exit 1
fi
close
elif [ "$1" = "open" ]; then
if pgrep -x "waybar" > /dev/null; then
exit 1
fi
open
else
echo "Usage: $0 [close|open]"
exit 1
fi