add a amixer volume ramp testfile

This commit is contained in:
Martin Selbmann 2020-09-23 09:16:24 +02:00
parent 058135d80b
commit 2bcafd6f08
1 changed files with 30 additions and 0 deletions

30
volumetest.sh Executable file
View File

@ -0,0 +1,30 @@
#!/bin/sh
volumevalue=$(amixer sget Master | grep 'Right:' | awk -F'[][]' '{ print $2 }' | tr -d '%')
timeout=$1
if [ -z "$timeout" ]; then
echo "Timeout missing!"
exit 1
fi
if [ "$volumevalue" -eq 0 ]; then
while [ "$volumevalue" -lt 100 ]; do
volumevalue=$((volumevalue + 1))
amixer -q sset 'Master' $volumevalue%
echo $volumevalue
sleep $timeout
done
elif [ "$volumevalue" -gt 0 ]; then
while [ "$volumevalue" -gt 0 ]; do
volumevalue=$((volumevalue - 1 ))
amixer -q sset 'Master' $volumevalue%
echo $volumevalue
sleep $timeout
done
fi