Last active
August 29, 2015 14:07
-
-
Save travis-g/1411634779daa0af54be to your computer and use it in GitHub Desktop.
Volume change hotkey script
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 | |
# by @travis-g, WTFPL 2 (https://wtfpl2.com/) | |
function showHelp() { | |
echo "Usage: vol_change.sh [up|down INT] | |
"; exit $1; } | |
if [[ ! $@ ]] ; then showHelp 1; fi # show help if no opts | |
i=5 && [[ $2 =~ ^[0-9]+$ ]] && i=$2 # set base increment | |
case $1 in | |
"up") i=$i"+";; | |
"down") i=$i"-";; | |
"-h"|"help") showHelp 0;; | |
esac; | |
amixer set Master $i | |
# vim: set ts=2 ft=bash |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment