configuration/local/bin/sound_control.sh

16 lines
353 B
Bash
Executable File

#!/bin/bash
command="${1:=toggle}"
current="$(amixer get Master | sed -n '/%/s/.*\[\(.*\)%\].*/\1/p' | head -1)"
case $command in
toggle) amixer set Master toggle ;;
down) amixer set Master "$((current - 5))%" ;;
up) amixer set Master "$((current + 5))%" ;;
*) notify-send "learn to volume" ;;
esac
sound_notification.sh