From eb68cc235345710249fad1b11f88c630c84736b9 Mon Sep 17 00:00:00 2001 From: coolneng Date: Mon, 19 Apr 2021 14:08:46 +0200 Subject: [PATCH] Work around mic pulseaudio ID value with a script --- scripts/.local/share/scripts/pulseaudio-mic-mute | 12 ++++++++++++ sway/.config/sway/config | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100755 scripts/.local/share/scripts/pulseaudio-mic-mute diff --git a/scripts/.local/share/scripts/pulseaudio-mic-mute b/scripts/.local/share/scripts/pulseaudio-mic-mute new file mode 100755 index 0000000..52ef16c --- /dev/null +++ b/scripts/.local/share/scripts/pulseaudio-mic-mute @@ -0,0 +1,12 @@ +#!/bin/sh + +pulsemixer $(\ + pulsemixer --list-sources |\ + grep Default |\ + awk -v args="$args" '{ + gsub(/,$/,"",$3); + cmdargs = cmdargs"--id "$3" "args" " + } END { + print cmdargs + }' +) --toggle-mute diff --git a/sway/.config/sway/config b/sway/.config/sway/config index 3b8219a..e764f70 100644 --- a/sway/.config/sway/config +++ b/sway/.config/sway/config @@ -259,7 +259,7 @@ exec swaymsg split vertical bindsym XF86AudioRaiseVolume exec pulsemixer --change-volume +5 bindsym XF86AudioLowerVolume exec pulsemixer --change-volume -5 bindsym XF86AudioMute exec pulsemixer --toggle-mute -bindsym XF86AudioMicMute exec pulsemixer --id source-43 --toggle-mute +bindsym XF86AudioMicMute exec ~/.local/share/scripts/pulseaudio-mic-mute # Brightness bindsym XF86MonBrightnessUp exec light -A 10 bindsym XF86MonBrightnessDown exec light -U 10