arch: add setter for volume.sh

This commit is contained in:
Henrik Lissner 2016-10-19 21:58:30 +02:00
parent 15958114cd
commit 318254623f

View file

@ -2,16 +2,16 @@
if [[ $# == 0 ]] if [[ $# == 0 ]]
then then
echo "Usage: volume.sh [+|-|unmute|mute]" echo "$(amixer get Master | sed -n 's/^.*\[\([0-9]\+\)%.*$/\1/p' | uniq)"
exit 1 exit
fi fi
COMMAND=$1 COMMAND=$1
case "$COMMAND" in case "$COMMAND" in
[0-9]*) amixer set Master $COMMAND ;;
[+-]) amixer set Master 10%$COMMAND ;; [+-]) amixer set Master 10%$COMMAND ;;
*mute) amixer set Master $COMMAND ;; *mute) amixer set Master $COMMAND ;;
*) *) >&2 echo "Invalid command"
echo "Invalid command"
exit 1 exit 1
;; ;;
esac esac