Update morning-alarm.sh script

The morning-alarm.sh script has been modified with the following changes:

- Added the 'break' statement after killing the mpv process to exit the loop when the alarm is dismissed. This prevents unnecessary iterations and improves script efficiency.
- Commented out the line 'killall /data/data/com.termux/files/usr/bin/mpv' since it seems to be redundant after the 'killall mpv' command. If this line is intended for different use, it may need further clarification or context.

These changes enhance the morning-alarm.sh script by optimizing the loop's termination when the alarm is dismissed, improving script efficiency and preventing unnecessary iterations. The redundant 'killall' line has been commented out for clarification.
This commit is contained in:
Ratatoskr 2024-02-01 13:55:59 +01:00
parent 313e9c8737
commit 62243df8ac
Signed by: Ratatoskr
GPG Key ID: 28B77439A6D78F4E

View File

@ -31,6 +31,8 @@ check_notification() {
else else
date && echo "Alarm dismissed." date && echo "Alarm dismissed."
killall mpv killall mpv
break
#killall /data/data/com.termux/files/usr/bin/mpv
echo "$output" echo "$output"
exit exit
fi fi
@ -51,5 +53,6 @@ done &
for ((volume = 20; volume <= 100; volume += 10)); do for ((volume = 20; volume <= 100; volume += 10)); do
echo "Actual volume: $volume" echo "Actual volume: $volume"
/data/data/com.termux/files/usr/bin/mpv --replaygain=track --volume="$volume" /data/scripts/your-new-morning-alarm.ogg /data/data/com.termux/files/usr/bin/mpv --replaygain=track --volume="$volume" /data/scripts/your-new-morning-alarm.ogg
#check_notification &
done done