Skip to content

Instantly share code, notes, and snippets.

@cmavr8
Created September 19, 2011 13:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cmavr8/1226520 to your computer and use it in GitHub Desktop.
Save cmavr8/1226520 to your computer and use it in GitHub Desktop.
Mute/Unmute microphone on a Lenovo X201s
#!/bin/bash
#Map this script to a button (eg F1) to mute your mic while VoIPing
currentlevel=`amixer get Capture |grep "Front Left:" | awk '{ print ($5) }'`
if [ $currentlevel == '[100%]' ]; then
amixer set Capture 0
echo "Mic muted" >> /tmp/mutelog
elif [ $currentlevel == '[0%]' ]; then
amixer set Capture 100
echo "Mic unmuted" >> /tmp/mutelog
else
echo "Bad mic value. Mic muted anyway for safety" >> /tmp/mutelog
amixer set Capture 0
fi
@cmavr8
Copy link
Author

cmavr8 commented Oct 28, 2011

Improvement: just use this command:
amixer set Capture toggle

works on every ubuntu pc I tried, much better...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment