Increase volume in steps

I would like to modify this so the buzzer starts at 15% and goes up to 30% in volume while it is playing.

amixer -D pulse sset Master 30% > /dev/null 2>&1  
cvlc --play-and-exit /usr/share/sounds/My_Sounds/Alarm-sound-buzzer.mp3 > /dev/null 2>&1  
echo 'TIME IS UP.' gxmessage -fg blue -font  'sans 20' -timeout 2 ' TIME IS UP !!'

I tried using code tags, but it ended up as one line.

Since these are Linux apps you are using, sleep 500m means sleep 500 milleseconds or one half of a second

# bump.shl
# increase volume by 5% every half second - in background
 for (( i=0 i<5; i++))
 do
  amixer sset Master 5%+
  sleep 500m
done 
amixer -D pulse sset Master 15% > /dev/null 2>&1  
# call child process
/path/to/bump.shl &
pid=$!
cvlc --play-and-exit /usr/share/sounds/My_Sounds/Alarm-sound-buzzer.mp3 > /dev/null 2>&1  
echo 'TIME IS UP.' gxmessage -fg blue -font  'sans 20' -timeout 2 ' TIME IS UP !!'
# clean up child if needed
kill -0 $pid && kill $pid
wait
2 Likes

Volume starts at 15% and ends at 15%.

What permissions should I give bump.shl?

andy@7_~/Downloads$ t1.sh 5
/home/andy/bin/t1.sh: line 9: /home/andy/bin/bump.shl: Permission denied
/home/andy/bin/t1.sh: line 14: kill: (3024) - No such process