feat: toggling audio between speakers
This commit is contained in:
@ -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
|
||||||
|
@ -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
1
scripts/status
Normal file
@ -0,0 +1 @@
|
|||||||
|
headphones
|
12
scripts/toggle-speakers.bash
Normal file
12
scripts/toggle-speakers.bash
Normal 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
|
Reference in New Issue
Block a user