You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
573 B

5 years ago
#!/usr/bin/env sh
device() {
amixer sget Earpiece | grep -E '\[on\]' > /dev/null && echo Earpiece && return
amixer sget Headphone | grep -E '\[on\]' > /dev/null && echo Headphone && return
echo "Line Out"
}
notify() {
sxmo_notify.sh 200 "Volume $(
amixer get "$(device)" |
grep -oE '([0-9]+)%' |
tr -d ' %' |
awk '{ s += $1; c++ } END { print s/c }' |
xargs printf %.0f
)"
5 years ago
echo 1 > /tmp/sxmo_bar
}
up() {
amixer set "$(device)" 1+
notify
}
down() {
amixer set "$(device)" 1-
notify
5 years ago
}
setvol() {
amixer set "$(device)" $1
}
5 years ago
$@