mirror of
https://github.com/LukeSmithxyz/voidrice.git
synced 2026-03-20 01:37:45 +01:00
Replace case with a function call
This commit is contained in:
parent
3222354d50
commit
32c88a2f13
@ -1,5 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
COMMAND="${1:-help}"
|
||||||
NUM="${2:-5}"
|
NUM="${2:-5}"
|
||||||
|
|
||||||
# Uncomment the following line to use Pulseaudio.
|
# Uncomment the following line to use Pulseaudio.
|
||||||
@ -19,10 +20,12 @@ else
|
|||||||
control() { alsamixer ;}
|
control() { alsamixer ;}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
case "$1" in
|
help() {
|
||||||
toggle) toggle ;;
|
echo "usage: lmc <command> [<num>]"
|
||||||
mute) mute ;;
|
echo "commands:"
|
||||||
up) up ;;
|
sed -n 's/^\s*\(\S*\)().*/- \1/p' "$0" | sort -u
|
||||||
down) down ;;
|
}
|
||||||
control) control ;;
|
|
||||||
esac
|
type "$COMMAND" | grep function >/dev/null && "$COMMAND" \
|
||||||
|
|| echo "lmc: command not defined: $COMMAND" >&2
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user