-
-
Save pfactum/a15a0dcd034172de3a29 to your computer and use it in GitHub Desktop.
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/sh | |
# amixer options | |
CHANNEL=Master # usually Master, but for Asus EEE, this is iSpeaker | |
CARD=0 # Which sound card, if your system has more than one? | |
VOL_STEP=2 # amount to increase / decrease volume | |
# notify-send options | |
DELAY=1000 # milliseconds to show the OSD | |
if [ "$1" = "mute" ]; then | |
amixer -c $CARD set $CHANNEL toggle >/dev/null 2>&1 | |
elif [ "$1" = "up" ]; then | |
amixer -c $CARD set $CHANNEL $VOL_STEP+ >/dev/null 2>&1 | |
elif [ "$1" = "down" ]; then | |
amixer -c $CARD set $CHANNEL $VOL_STEP- >/dev/null 2>&1 | |
else | |
echo "Usage: $0 up|down|mute" | |
exit 1 | |
fi | |
STATUS=$(amixer -c $CARD sget ${CHANNEL} | grep -c "\\[on\\]") | |
VOLUME=$(amixer -c $CARD sget ${CHANNEL} | awk '$0 ~ "%" { vol=$(NF-2); \ | |
gsub("\\[", "", vol); gsub("\\]", "",vol); print vol; exit; }' ) | |
if [ $STATUS -eq 0 ]; then | |
volnoti-show -m | |
else | |
volnoti-show $VOLUME | |
fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment