Created
December 28, 2012 21:30
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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