mirror of
https://github.com/LukeSmithxyz/voidrice.git
synced 2026-03-20 01:37:45 +01:00
32 lines
745 B
Bash
Executable File
32 lines
745 B
Bash
Executable File
#!/bin/sh
|
|
|
|
COMMAND="${1:-help}"
|
|
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" ;}
|
|
control() { pulsemixer ;}
|
|
else
|
|
toggle() { amixer sset Master toggle ;}
|
|
mute() { amixer sset Master mute ;}
|
|
up() { amixer sset Master "$NUM"%+ ;}
|
|
down() { amixer sset Master "$NUM"%- ;}
|
|
control() { alsamixer ;}
|
|
fi
|
|
|
|
help() {
|
|
echo "usage: lmc <command> [<num>]"
|
|
echo "commands:"
|
|
sed -n 's/^\s*\(\S*\)().*/- \1/p' "$0" | sort -u
|
|
}
|
|
|
|
type "$COMMAND" | grep function >/dev/null && "$COMMAND" \
|
|
|| echo "lmc: command not defined: $COMMAND" >&2
|
|
|