add ability to switch audio devices in hypr

This commit is contained in:
Tyler Starr 2023-12-28 11:36:20 -08:00
parent 24ad403f6d
commit d0ce5ae885
3 changed files with 8 additions and 0 deletions

View File

@ -18,6 +18,9 @@ binde = , h, resizeactive, -50 0
binde = , j, resizeactive, 0 50
binde = , k, resizeactive, 0 -50
binde = , l, resizeactive, 50 0
bind = , 1, exec, ~/.config/hypr/scripts/audio-device-switcher.sh 1 $e
bind = , 2, exec, ~/.config/hypr/scripts/audio-device-switcher.sh 2 $e
bind = , 3, exec, ~/.config/hypr/scripts/audio-device-switcher.sh 3 $e
bind = , escape, submap, reset
submap = reset

View File

@ -0,0 +1,4 @@
#!/usr/bin/env bash
#
sink=$(pactl list sinks | grep "Sink #" | head -n $1 | tail -n 1)
pactl set-default-sink $(echo $sink | cut -d "#" -f 2)

View File

@ -59,6 +59,7 @@
"format-muted": "󰖁 {format_source}",
"format-bluetooth": "{icon}  <span color=\"{{ .themes.gruvbox.red }}\">{volume}</span>% {format_source}",
"format-bluetooth-muted": "󰖁  {format_source}",
"tooltip": false,
"format-source": "  <span color=\"{{ .themes.gruvbox.red }}\">{volume}</span>%",
"format-source-muted": "",