Created
February 23, 2011 16:21
-
-
Save avuserow/840644 to your computer and use it in GitHub Desktop.
script to change volume on thinkpads, and also synchronize the hardware mute with the software mute. First argument is up to raise by 10%, down to lower by 10%, or no argument to just automatically mute/unmute.
This file contains hidden or 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/sh | |
MUTED=`perl -lne'print (/mute:\s+(\w+)/) if /mute:/' < /proc/acpi/ibm/volume` | |
# default to muted if the state is unknown | |
if [ "${MUTED}" == "off" ] ; then | |
amixer set Master on -q | |
else | |
amixer set Master off -q | |
fi | |
if [ "$1" == "up" ]; then | |
amixer set Master 10%+ -q | |
fi | |
if [ "$1" == "down" ]; then | |
amixer set Master 10%- -q | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment