diff --git a/config/hypr/hyprland.conf b/config/hypr/hyprland.conf index 7ce446d5..a42038b1 100644 --- a/config/hypr/hyprland.conf +++ b/config/hypr/hyprland.conf @@ -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 diff --git a/scripts/toggle-waybar.bash b/scripts/toggle-waybar.bash new file mode 100644 index 00000000..d082f516 --- /dev/null +++ b/scripts/toggle-waybar.bash @@ -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 diff --git a/scripts/waybar-status b/scripts/waybar-status new file mode 100644 index 00000000..e69de29b