From d0ce5ae8858d672db9a9cf4bbaf1793fa19a8d25 Mon Sep 17 00:00:00 2001 From: Tyler Starr Date: Thu, 28 Dec 2023 11:36:20 -0800 Subject: [PATCH] add ability to switch audio devices in hypr --- home/dot_config/hypr/keybinds.conf | 3 +++ .../hypr/scripts/executable_audio-device-switcher.sh | 4 ++++ home/dot_config/waybar/config.tmpl | 1 + 3 files changed, 8 insertions(+) create mode 100644 home/dot_config/hypr/scripts/executable_audio-device-switcher.sh diff --git a/home/dot_config/hypr/keybinds.conf b/home/dot_config/hypr/keybinds.conf index caa1c0fc..176c02ed 100644 --- a/home/dot_config/hypr/keybinds.conf +++ b/home/dot_config/hypr/keybinds.conf @@ -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 diff --git a/home/dot_config/hypr/scripts/executable_audio-device-switcher.sh b/home/dot_config/hypr/scripts/executable_audio-device-switcher.sh new file mode 100644 index 00000000..0593823b --- /dev/null +++ b/home/dot_config/hypr/scripts/executable_audio-device-switcher.sh @@ -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) diff --git a/home/dot_config/waybar/config.tmpl b/home/dot_config/waybar/config.tmpl index ce6667b0..c15bd2a9 100644 --- a/home/dot_config/waybar/config.tmpl +++ b/home/dot_config/waybar/config.tmpl @@ -59,6 +59,7 @@ "format-muted": "󰖁 {format_source}", "format-bluetooth": "{icon}  {volume}% {format_source}", "format-bluetooth-muted": "󰖁  {format_source}", + "tooltip": false, "format-source": "  {volume}%", "format-source-muted": "",