1
0
Fork 0

Pomodoros

This commit is contained in:
Malte 2022-11-07 12:31:49 +01:00
parent 0e69a41e49
commit 670d17c6aa

View file

@ -16,11 +16,19 @@ fi
current_seconds=$(date +%-S)
current_minute=$(date +%-M)
if (($current_minute < 30)); then
echo "Next ring at half hour."
if (($current_minute < 25)); then
mpv $HOME/media/audio/bell.opus
echo "Next ring at 25."
sleep_seconds=$(( (24 - $current_minute)*60+ (60 - $current_seconds)))
elif (($current_minute < 30)); then
echo "Next ring at 30."
sleep_seconds=$(( (29 - $current_minute)*60+ (60 - $current_seconds)))
elif (($current_minute < 55)); then
mpv $HOME/media/audio/bell.opus
echo "Next ring at 55."
sleep_seconds=$(( (54 - $current_minute)*60+ (60 - $current_seconds)))
else
echo "Next ring at full hour."
echo "Next ring at 0."
sleep_seconds=$(( (59 - $current_minute)*60+ (60 - $current_seconds)))
fi