Skip to content

Instantly share code, notes, and snippets.

@raphaelm
Created December 28, 2012 21:30
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 raphaelm/4402112 to your computer and use it in GitHub Desktop.
Save raphaelm/4402112 to your computer and use it in GitHub Desktop.
Thinkpad X230 mic mute button status displayed in i3status, because even though you can make the button function via an ACPI event, it is impossible to use the button's LED with kernel 3.5 Requires: jshon
#!/bin/bash
i3status | while :
do
read line
if [[ "$line" == *"full_text"* ]] ; then
if ! amixer sget 'Capture',0 | grep '\[on\]' > /dev/null 2>&1 ; then
if [[ "$line" == ","* ]]; then
echo -n ","
fi
echo $line | sed s/^,//g | jshon -n object -i 0 -e 0 -s "name" -i "micmute" -s "mic muted" -i "full_text" -p | tr '\n' ' '
echo ""
else
echo $line
fi
else
echo $line
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment