-
-
Save lyleunderwood/1039303 to your computer and use it in GitHub Desktop.
bash script to change volume in ubuntu
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 | |
# DO THIS FIRST: | |
# sudo aptitude install libnotify-bin alsa-utils | |
# INSTALL: | |
# mkdir ~/bin | |
# cp ~/Downloads/vol ~/bin/vol | |
# chmod +x ~/bin/vol | |
# USAGE: | |
# vol up | |
# vol down | |
# vol mute | |
# vol unmute | |
# vol 10+ | |
# vol 5- | |
# vol 60% | |
# I usually use this from a launcher which can run arbitrary scripts, such | |
# as synapse or the alt+f2 launcher in 'buntu. | |
if [ $1 = "mute" ] | |
then | |
amixer set Master mute | |
notify-send "Volume muted" | |
elif [ $1 = "unmute" ] | |
then | |
amixer set Master unmute | |
notify-send "Volume unmuted" | |
elif [ $1 = "up" ] | |
then | |
str=`amixer set Master 5+` | |
vol=`echo $str| awk '{print $22}'` | |
notify-send "Volume $vol" | |
elif [ $1 = "down" ] | |
then | |
str=`amixer set Master 5-` | |
vol=`echo $str| awk '{print $22}'` | |
notify-send "Volume $vol" | |
else | |
str=`amixer set Master $1` | |
vol=`echo $str| awk '{print $22}'` | |
notify-send "Volume $vol" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment