NineToFive is a lightweight command-line application for keeping track of your
work hours. All of its functionality can be found in the work
executable,
which helps you log your activity while you work.
$ ./autogen.sh
$ ./configure
$ make
# make install
NineToFive keeps an event log, where each event has a description (such as
"started working") and a timestamp. The work
executable can be used as a
frontend to the event log.
The main work
executable.
The work start
command appends a start event to the event log with the
current time as a timestamp.
The work stop
command appends a stop event to the event log with the
current time as a timestamp.
The work status
command prints the current status of the event log.
The work working
command returns 0 if work is in progress according to the
event log, and 1 otherwise.
The work since TIME
command appends a start event to the event log with a
timestamp derived from TIME
. The TIME
variable can be of the following
forms:
X
, meaning atX
o'clock. If this is ambiguous then the last possible time is usedX:Y
, meaning atY
minutes pastX
o'clock. If this is ambiguous then the last possible time is usedXm
, meaningX
minutes agoXh
, meaningX
hours agoX:Yh
, meaningX
hours andY
minutes ago
Note that specifying seconds in a similar manner (possibly with the s
suffix)
is also supported, but is omitted here for simplicity.
work since 9 # I've been working since 9:00 this morning
work since 9:15 # I've been work since 9:15 this morning
work since 2:20h # I started working 2 hours and 20 minutes ago
The work at TIME
command appends a start event to the event log with a
timestamp derived from TIME
. The TIME
variable can be of the following
forms:
X
, meaning atX
o'clock. If this is ambiguous then the next possible time is usedX:Y
, meaning atY
minutes pastX
o'clock. If this is ambiguous then the next possible time is usedXm
, meaning afterX
minutesXh
, meaning afterX
hoursX:Yh
, meaning afterX
hours andY
minutes
Note that specifying seconds in a similar manner (possibly with the s
suffix)
is also supported, but is omitted here for simplicity.
It has the following options:
--notify
will generate a notification at the moment you should start working (according toTIME
)--execute CMD
will executeCMD
at the moment you should start working (according toTIME
)
work at 12 # I'm going to start working at noon
work at 12:15 # I'm going to start working at quarter past noon
work at 2:20h # I'm going to start working in 2 hours and 20 minutes
work at 2:20h --notify
work at 2:20h --run 'notify-send "Get to work!"'
TODO: work until a given time with support for notifications like work at
. Should it support negative time?
TODO: work for some given amount of time with support for notifications like work at
. Should it support negative time? Maybe merge with work until
?
TODO: add a on XXX event to the event log, which is a hint/tag for what you are working on. Possibly also support --on
options for other commands.
The work while CMD
command appends a start event to the event log with the
current time as a timestamp, then executes CMD
and waits for it to exit, and
finally appends a stop event to the log with the time when CMD
ended as a
timestamp. This is equivalent to running the following:
$ work start && (CMD || true) && work stop
work while bash # Run a bash shell where I do my work
work while "sleep 60" # An alternative way to work for 1 minute
The work merge LOG1 LOG2 LOG3...
command takes zero or more NineToFive
event logs and combines them into one. It has the following options:
--output FILE
specifies where to write the output. By defaultFILE
is-
, which represents the standard output.
TODO: somehow export data or generate a LaTeX file which can be used to generate an invoice. Only work hours since the last invoice was created (i.e. the last invoice event) will be used (so add stop, invoice, start events in that order).
-
Decide if we should merge
since
/at
intostart
anduntil
/for
intostop
with some super syntax for specifying TIME. It's probably enough to have a+
and-
prefix depending on what the user wants to use. -
Support multiple event logs in a clean way.
-
Timestamps in the event log should have a timezone, so that commands like
work merge
work correctly on logs from multiple machines.