voidrice/.local/bin/lmc
2020-03-22 09:41:50 -04:00

27 lines
569 B
Bash
Executable file

#!/bin/sh
NUM="${2:-5}"
# Uncomment the following line to use Pulseaudio.
# PULSE=true
if [ "$PULSE" ]; then
toggle() { pulsemixer --toggle-mute ;}
mute() { pulsemixer --mute ;}
up() { pulsemixer --change-volume +"$NUM" ;}
down() { pulsemixer --change-volume -"$NUM" ;}
else
toggle() { amixer sset Master toggle ;}
mute() { amixer sset Master mute ;}
up() { amixer sset Master "$NUM"%+ ;}
down() { amixer sset Master "$NUM"%- ;}
fi
case "$1" in
toggle) toggle ;;
mute) mute ;;
up) up ;;
down) down ;;
esac >/dev/null
pkill -RTMIN+10 "${STATUSBAR:?}" &