#!/bin/sh

say() {
	if [ -n "$DISPLAY" ]; then
		notify-send "Pomodoro 🍅" "$1"
	fi
	printf "%s -- 🍅 Pomodoro: %s\n" "$(date +'%H:%M:%S')" "$1"
}

while true
do
	for i in 1 2 3 4
	do
		say "Start working... 🔨"
		sleep $((60 * 25))
		if [ 4 -eq "$i" ]
		then
			say "Take a longer break... 💤"
			sleep $((60 * 15))
		else
			say "Take a short break... 💤"
			sleep $((60 * 5))
		fi
	done
done