From 626bd5b7f1dbb0b330b6bdbf9aaf702241abda43 Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Thu, 5 Jan 2012 20:50:14 +0100 Subject: Add keybindings + scripts to mute mic and speakers on x220 --- .scripts/toggle_mute.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 .scripts/toggle_mute.sh (limited to '.scripts') diff --git a/.scripts/toggle_mute.sh b/.scripts/toggle_mute.sh new file mode 100755 index 0000000..0d6edd1 --- /dev/null +++ b/.scripts/toggle_mute.sh @@ -0,0 +1,11 @@ +dev="alsa_output.pci-0000_00_1b.0.analog-stereo" +tp=ink + +if [[ "x$1" = "xinput" ]]; then + dev="alsa_input.pci-0000_00_1b.0.analog-stereo" + tp=ource +fi + +LC_ALL=C pactl list | \ + sed -n -e:a -eN -e"/^S$tp.*Name: $dev.*Mute: no/q1" -e'/\n$/d' -eba +pactl "set-s$tp-mute" $dev $? -- cgit