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.
 
 
 

23 lines
528 B

#!/usr/bin/env sh
device() {
amixer sget Headphone && echo Headphone || echo Speaker
}
incvol() {
amixer set $(device) 1+
echo 1 > /tmp/sxmo_bar
}
decvol() {
amixer set $(device) 1-
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
)"