scripts

My personal collection of scripts
git clone git://src.gearsix.net/scripts
Log | Files | Refs | Atom | README | LICENSE

commit 59d77bed3d85769f57cd1aed7397e42b0bbd0339
parent ba36f1eacd3ec67da4c4b1012ecb24e43f184b08
Author: gearsix <gearsix@tuta.io>
Date:   Fri, 25 Jun 2021 13:37:39 +0100

added a notify script for pomodoro

Diffstat:
Asrc/pomodoro.sh | 25+++++++++++++++++++++++++
1 file changed, 25 insertions(+), 0 deletions(-)

diff --git a/src/pomodoro.sh b/src/pomodoro.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env sh + +if [ "$1" == "-h" ] || [ "$1" == "--help" ]; then + echo "pomdoro" + echo "usage: pomodoro [OPTIONS]" + echo "" + echo "OPTIONS" + echo " -s, --short Take short (5 minute breaks), default." + echo " -l, --long Take long (15 minute breaks)." + echo " -h, --help Print this message" + exit +fi + +NOTIFY=$NOTIFY +WORK=25m +BREAK=5m +if [ "$1" == "--long" ]; then BREAK=15m; fi + +notify-send -t $NOTIFY -a pomodoro "Begin" "Work for 25m. Break for $BREAK.\nRepeat." +if [ -s $? ]; then echo "notify-send failed, aborting"; fi + +while [ true ]; do + sleep "$WORK" && notify-send -t $NOTIFY -a pomodoro "Take a break" "You've been working for $WORK, time for a $BREAK break." + sleep "$BREAK" && notify-send -t $NOTIFY -a pomodoro "Back to work" "$BREAK break is over, back to being busy for 25m." +done