feat: toggleing waybar
This commit is contained in:
@ -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
|
||||
|
14
scripts/toggle-waybar.bash
Normal file
14
scripts/toggle-waybar.bash
Normal 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
0
scripts/waybar-status
Normal file
Reference in New Issue
Block a user