1.0.0-rc3 • Published 6 years ago

pmdclock v1.0.0-rc3

Weekly downloads
2
License
WTFPL
Repository
github
Last release
6 years ago

pmdclock, a simple CLI pomodoro clock

Clock for pomodore control based on an agent

Features:

  • 100% CLI
  • Configurable times
  • Continuous mode
  • Persist taks history on disk
  • Notification by libnotify (Desktop integrated)
  • Execute custom command when finish time
  • Auto large rests after x completed tasks

Install

You need node.js (~7.4.0 recommended) and npm installed.

$ sudo npm install -g pmdclock

Usage

Start the agent:

$ pmdclock agent
Starting agent
$

Start new task

$ pmdclock start -n "Cooking potatoes"
Task started!

Let's work...

Get information

$ pmdclock info
Cooking potatoes finish in 17 minutes

Finish the task

$ pmdclock finish
Task finished! in 8 minutes

Take a rest

$ pmdclock rest
Rest started!

Or, a large rest:

$ pmdclock rest --large
Large rest started!, be happy
$ pmdclock finish
Rest finished at 1 minutes

Check the history:

$ pmdclock list
┌───┬──────────────────┬──────────────────┬──────────────────┬──────────┐
│   │ Name             │ Started          │ Finished         │ On time  │
│ * │ Cooking potatoes │ Today at 5:05 PM │ Today at 5:13 PM │ -25 mins │
│ - │ Rest             │ Today at 5:14 PM │ Today at 5:15 PM │ -5 mins  │
└───┴──────────────────┴──────────────────┴──────────────────┴──────────┘

Clear history:

$ pmdclock clear
History clear, 2 tasks deleted.
$ pmdclock list
Not tasks finished

Continuous mode

Continuous mode allows to finish tasks starting rest and vice versa:

$ pmdclock start -n "Cooking potatoes"
Task started!
$ pmdclock rest
Task finished!
Rest started!
$ pmdclock start -n "Prepare dishes"
Rest finished!
Task started!
$ pmdclock finish
Task finished! in 0 minutes 
$ pmdclock list
┌───┬──────────────────┬──────────────────┬──────────────────┬──────────┐
│   │ Name             │ Started          │ Finished         │ On time  │
│ * │ Cooking potatoes │ Today at 5:19 PM │ Today at 5:19 PM │ -25 mins │
│ - │ Rest             │ Today at 5:19 PM │ Today at 5:19 PM │ -5 mins  │
│ * │ Prepare dishes   │ Today at 5:19 PM │ Today at 5:20 PM │ -25 mins │
└───┴──────────────────┴──────────────────┴──────────────────┴──────────┘

Configure

The default configuration uses times by: 25 minutes task, 5 minutes rest and 20 minutes for large rests, but it's configurable via a json file located in $HOME/.pmdclock/config.yml:

For example:

taskTime: 40
restTime: 10
largeRestTime: 30 

The complete params are:

ParamTypeDescriptionDefault value
socketStringPath of the socket file for agent/run/user/{UUID}/pmdclock.socket`
dbStringPath of the db file$HOME/.pmdclock/db.dat
daemonBooleanRun agent as daemontrue
taskTimeNumberTask time in minutes25
restTimeNumberRest time in minutes5
largeRestTimeNumberLarge rest time in minutes20
autoLargeRestBoolean/NumberAuto set the next rest as large after x complete tasks, if false don't auto-set4
showNotificationsBooleanShow notifications via libnotifytrue
runCmdStringCommand to run when time is overnull
autoStopCmdString/BooleanStop command on finish task, if is false don't kill the child, if is true, kill with SIGTERM, if is string, use it as signal, enable signals: SIGHUP, SIGINT, SIGQUIT, SIGKILL, SIGTERM, SIGUSR1, SIGUSR2, SIGCHLD, SIGSTOP, SIGTSTPfalse
notifyEachNumberNotify each x time, in secods30
infoFormatStringOutput format of comand info0"%n finish in %R"
continueModeBooleanIf start a rest when a task is running, close the task and vise versatrue
taskIconStringTask icon on list1x
taskRunningIconStringIcon for running task1>
restIconStringRest icon in list1o/
largeRestIconStringLarge rest icon1...
largeRestRunningIconStringIcon for running large rest1:D
reverseSortBooleanList in reverse by defaultfalse
defaultListHeadNumberList appling --head parman by default, see pmdclock list --help0
defaultListTailNumberList appling --tail parman by default, see pmdclock list --help0

0: Info variables

The variables start with % and there are:

  • n: Name of task
  • i: Icon
  • r: Time left on mm:ss
  • R: Time left on human readable format, ej: 13 minutes
  • e: Time elapsed on mm:ss
  • E: Time elapsed on human readable format
  • t: Number of tomatoes recolected
  • T: Repeat the taskIcon the total tomatoes recolected times

1: Tasks icons

If you use fonts patches with Pomicons you can use it for stylish output of list command.

pomicons

For use it, define icons as \uE001 and \uE005.

taskIcon: "\uE001"
taskRunningIcon: "\uE004"
restIcon: "\uE005"
restRunningIcon: "\uE005"
largeRestIcon: "\uE006"
largeRestRunningIcon: "\uE006"

Usage with i3wm + i3blocks

The reasons why I developed this software, apart from not finding anything similar that I like, it was to implement it on my desktop with i3 + i3blocks, so I leave the configuration in case someone else serves:

[pomodoro]
command=pmdclock info --format "%T%i %r" | sed "s/^Not tasks.*$//g"
color=#FFFF00
interval=5