diff options
| author | Mike Vink <mike@pionative.com> | 2024-06-10 20:33:17 +0200 |
|---|---|---|
| committer | Mike Vink <mike@pionative.com> | 2024-06-10 20:33:17 +0200 |
| commit | 70623bff625d9f937d6d6d8458eb7dfca796a11c (patch) | |
| tree | afe90484e17002ed1c93b7cd57933ad6356007c2 /mut | |
| parent | 4b187aad773f4f8e7f1e649953bcc17fe425b0bc (diff) | |
pomodoro fix
Diffstat (limited to 'mut')
| -rwxr-xr-x | mut/bin/sb-pomodoro | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/mut/bin/sb-pomodoro b/mut/bin/sb-pomodoro index 8d4fc69..1eb222a 100755 --- a/mut/bin/sb-pomodoro +++ b/mut/bin/sb-pomodoro @@ -26,6 +26,9 @@ if [ -z "$status" ]; then if [ "$daily_completed" -ne "0" ]; then seconds_since_last_started="$(( $(date +%s -u) - $(tail -n1 ~/.pomodoro/history | cut -f1 -d' ' | xargs -I{} date -d"{}" +%s -u) ))" seconds_since_last="$(( "$seconds_since_last_started" - 60*$(tail -n1 ~/.pomodoro/history | cut -f2 -d' ' | cut -f2 -d'=')))" + if [ "$seconds_since_last" -lt 0 ]; then + seconds_since_last=0 + fi msg="$(date -d@"$seconds_since_last" +"%H:%M" -u)min ago $msg" fi echo "$msg" |
