From cddac62814a14fdd534adb2aa875df9dfeadac06 Mon Sep 17 00:00:00 2001 From: Gardouille Date: Thu, 15 Oct 2015 09:51:47 +0200 Subject: [PATCH] Add pomodoro script to manage time. See https://orangina-rouge.org/plux/index.php?article39/travail-la-methode-pomodoro --- pomodoro.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 pomodoro.sh diff --git a/pomodoro.sh b/pomodoro.sh new file mode 100755 index 0000000..ba7e7e2 --- /dev/null +++ b/pomodoro.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +TIME=0 +# Work on the task (default: 25 min) +DELAY=25 +# Task information (name, path, …) +TASK_NAME="${1}" +TASK_PATH="${HOME}/${TASK_NAME}.todo" + +# Create the task file +if [ ! -f "${TASK_PATH}" ]; then + touch "${TASK_PATH}" +fi + +# Tiny timer +while [ "${TIME}" != "${DELAY}" ] +do + #sleep 60 + sleep 1 + TIME=$((TIME+1)) + # Add some colors + printf '%b' "${TIME}" > "${TASK_PATH}" +done + +exit 0