From 1bb6546100d78b82815f5debf2eba6ebc450debe Mon Sep 17 00:00:00 2001 From: Ratatoskr Date: Tue, 30 Jan 2024 23:18:20 +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 | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/morning-alarm.sh b/morning-alarm.sh index cca9d8f..8762d07 100755 --- a/morning-alarm.sh +++ b/morning-alarm.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/data/data/com.termux/files/usr/bin/zsh # # Alarm Control Script # @@ -41,13 +41,15 @@ check_notification() { # Turn off Bluetooth turn_off_bluetooth -## 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 increase_volume check_notification +done & + +## Play alarm sound +for ((volume = 20; volume <= 100; volume += 10)); do + echo "Actual volume: $volume" + /data/data/com.termux/files/usr/bin/mpv --replaygain=track --volume="$volume" /data/scripts/your-new-morning-alarm.ogg done +