From 89fd2f2f8c0c860f92f70668bf9773c5b6726d02 Mon Sep 17 00:00:00 2001 From: Ratatoskr Date: Tue, 30 Jan 2024 22:39:21 +0100 Subject: [PATCH] Improve morning-alarm.sh script Enhancements: - Adjusted the way the alarm sound is played by introducing a loop to increase volume gradually. - Utilized a loop to iterate over volume levels from 10 to 100 with increments of 10. - Replaced the previous mpv command with a loop to control the volume for a smoother alarm experience. Code Clarity: - Added comments to clarify the purpose of the loop and volume adjustment. Note: This modification provides a more gradual increase in volume for the morning alarm, enhancing the user experience. --- morning-alarm.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/morning-alarm.sh b/morning-alarm.sh index 9812111..cca9d8f 100755 --- a/morning-alarm.sh +++ b/morning-alarm.sh @@ -41,8 +41,10 @@ check_notification() { # Turn off Bluetooth turn_off_bluetooth -# Play alarm sound -/data/data/com.termux/files/usr/bin/mpv --replaygain=track --loop=inf /data/scripts/your-new-morning-alarm.ogg & +## Play alarm sound +for ((volume = 10; volume <= 100; volume += 10)); do + /data/data/com.termux/files/usr/bin/mpv --replaygain=track --volume="$volume" /data/scripts/your-new-morning-alarm.ogg & +done # Increase volume and check notification while true; do