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.

24 lines
528 B

5 years ago
#!/usr/bin/env sh
device() {
amixer sget Headphone && echo Headphone || echo Speaker
}
5 years ago
incvol() {
amixer set $(device) 1+
5 years ago
echo 1 > /tmp/sxmo_bar
}
decvol() {
amixer set $(device) 1-
5 years ago
echo 1 > /tmp/sxmo_bar
}
echo $1 | grep up && echo 1 > /tmp/sxmo_bar && incvol
echo $1 | grep down && echo 1 > /tmp/sxmo_bar && decvol
sxmo_notify.sh 200 "Volume $(
echo "$(amixer sget Headphone || amixer sget Speaker)" |
grep -oE '([0-9]+)%' |
tr -d ' %' |
awk '{ s += $1; c++ } END { print s/c }' |
xargs printf %.0f
)"