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.
This commit is contained in:
Ratatoskr 2024-01-30 22:39:21 +01:00
parent 14dcb406c6
commit 89fd2f2f8c
Signed by: Ratatoskr
GPG Key ID: 28B77439A6D78F4E

View File

@ -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