feat: toggleing waybar

This commit is contained in:
2025-05-20 10:59:19 +01:00
parent 35bee5b311
commit bf16c34de7
3 changed files with 16 additions and 0 deletions

View File

@ -235,6 +235,8 @@ bind = $mainMod, V, exec, cliphist list | fuzzel --dmenu | cliphist decode | wl-
bind = $mainMod, M, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle
bind = $mainMod, K, exec, bash ~/Code/dotfiles/scripts/toggle-speakers.bash
# Toggle waybar
bind = $mainMod, W, exec, bash ~/Code/dotfiles/scripts/toggle-waybar.bash
# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more
bind = $mainMod, T, exec, $terminal

View File

@ -0,0 +1,14 @@
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

0
scripts/waybar-status Normal file
View File