Commits

Yusuke MURAOKA committed 344c4b2

add CLI pomodoro timer

  • Participants
  • Parent commits 2c22a3c

Comments (0)

Files changed (1)

File dotfiles/.zshenv

 fi
 export PIP_DOWNLOAD_CACHE=~/.pip/cache
 
+
+function pomodoro {
+    cnt=$((25 * 60))  # 25 minutes
+    cnt=10
+    echo "The pomodoro: \"$1\""
+    while [ $cnt -ge 0 ]
+    do
+        minutes=$((cnt / 60))
+        seconds=$((cnt % 60))
+        echo -n "\r                "
+        printf "\rcount down: %02d:%02d" $minutes $seconds
+        sleep 1
+        cnt=$(($cnt - 1))
+    done
+    serif="The pomodoro \"$1\" has been done."
+    growlnotify -s -m "$serif"; say "$serif"
+    echo "\n$serif"
+}
+
+
 . ~/.zshenv.local