diff --git a/pomodoro.sh b/pomodoro.sh index c7e6a4f..d168997 100755 --- a/pomodoro.sh +++ b/pomodoro.sh @@ -2,7 +2,8 @@ TIME=0 # Work on the task (default: 25 min) -DELAY=25 +WORK_TIME=25 +BREAK_TIME=5 # Log informations LOG_DIR="${HOME}/.pomodoro" @@ -31,15 +32,25 @@ fi # Start working startedTime=$(date +"%H:%M") +printf '%b' "${TASK_NAME}\n${TIME}" > "${TASK_PATH}" + # Tiny timer -while [ "${TIME}" != "${DELAY}" ] -do - printf '%b' "${TASK_NAME}\n${TIME}" > "${TASK_PATH}" - sleep 1 +while [ "${TIME}" != "${WORK_TIME}" ]; do + sleep 60 TIME=$((TIME+1)) + printf '%b' "${TASK_NAME}\n${TIME}" > "${TASK_PATH}" done # Write logs printf '%b' "$(date +"%A (%F) $startedTime → %H:%M") $TASK_NAME" >> "${LOG_TASK_PATH}" +# Start break +printf '%b' "BREAK\n${BREAK_TIME}" > "${TASK_PATH}" + +while [ "${BREAK_TIME}" > 0 ]; do + sleep 60 + BREAK_TIME=$((BREAK_TIME-1)) +printf '%b' "BREAK\n${BREAK_TIME}" > "${TASK_PATH}" +done + exit 0