summaryrefslogtreecommitdiff
path: root/.scripts
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2012-01-05 20:50:14 +0100
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2012-01-05 20:50:14 +0100
commit626bd5b7f1dbb0b330b6bdbf9aaf702241abda43 (patch)
tree52b8cc8a67668a5a66c8a0455033fafb0354e4fc /.scripts
parent3d0f7e6211f3873417f8d0c69821dedd6879dbc0 (diff)
downloaddotfiles-626bd5b7f1dbb0b330b6bdbf9aaf702241abda43.tar.gz
dotfiles-626bd5b7f1dbb0b330b6bdbf9aaf702241abda43.tar.bz2
dotfiles-626bd5b7f1dbb0b330b6bdbf9aaf702241abda43.zip
Add keybindings + scripts to mute mic and speakers on x220
Diffstat (limited to '.scripts')
-rwxr-xr-x.scripts/toggle_mute.sh11
1 files changed, 11 insertions, 0 deletions
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 $?