scripts/pomodoro.sh

26 lines
405 B
Bash
Raw Normal View History

#!/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