feat: toggling audio between speakers

This commit is contained in:
2025-04-28 18:13:34 +01:00
parent 693dcccdf0
commit 98d8d45529
4 changed files with 21 additions and 3 deletions

View File

@ -231,7 +231,11 @@ $mainMod = SUPER # Sets "Windows" key as main modifier
bind = $mainMod SHIFT, S, exec, hyprshot -m region -o ~/Pictures/Screenshots bind = $mainMod SHIFT, S, exec, hyprshot -m region -o ~/Pictures/Screenshots
bind = $mainMod, V, exec, cliphist list | fuzzel --dmenu | cliphist decode | wl-copy bind = $mainMod, V, exec, cliphist list | fuzzel --dmenu | cliphist decode | wl-copy
# Audio control
bind = Control, M, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle bind = Control, M, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle
bind = Control, M, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle
bind = Control, T, exec, bash ~/Code/dotfiles/scripts/toggle-speakers.bash
# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more # Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more
bind = $mainMod, T, exec, $terminal bind = $mainMod, T, exec, $terminal

View File

@ -39,12 +39,13 @@
}, },
"pulseaudio": { "pulseaudio": {
// "scroll-step": 1, // %, can be a float // "scroll-step": 1, // %, can be a float
"format": "{icon} {volume}% {format_source}", "format": "{icon} {format_source} {volume}%",
"format-muted": "", "format-muted": "",
"format-source": "", "format-source": "",
"format-source-muted": "Muted", "format-source-muted": "",
"format-icons": { "format-icons": {
"default": ["", "", " "] "hdmi": ["", "", " "],
"default": ["", "", ""]
}, },
"on-click": "pavucontrol" "on-click": "pavucontrol"
}, },

1
scripts/status Normal file
View File

@ -0,0 +1 @@
headphones

View File

@ -0,0 +1,12 @@
#!/bin/bash
cd ~/Code/dotfiles/scripts
status=$(cat ./status)
if [ $status == "speakers" ]; then
wpctl set-default 62
echo "headphones" > ./status
else
wpctl set-default 68
echo "speakers" > ./status
fi