dotfiles/.local/bin/statusbar/getpomminutes

8 lines
369 B
Plaintext
Raw Normal View History

2020-07-04 14:23:27 +02:00
#!/bin/bash
day=$(date '+%Y%b%d')
logged=$(grep -v Break ~/eth/pomodoros | grep $(date '+%Y%b%d') | grep -Eo "\(.*\)" | paste -sd+ | bc)
temp=$(cat /tmp/pomptemptimes 2>/dev/null)
min=$([ "$logged" != "" ] && ([ "$temp" != "" ] && echo "$logged + $temp" | bc || echo $logged ) || ([ "$temp" != "" ] && echo $temp))
[ -n "$min" ] && printf '🍅%s' "$min"
printf '\n'