Skip to content

Instantly share code, notes, and snippets.

@travis-g
Last active August 29, 2015 14:07
Show Gist options
  • Save travis-g/1411634779daa0af54be to your computer and use it in GitHub Desktop.
Save travis-g/1411634779daa0af54be to your computer and use it in GitHub Desktop.
Volume change hotkey script
#!/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