Last Updated: February 25, 2016
· chick-chains

Work journal in the shell

Following the suggestion from @kazark at to keep a work journal I added this cmds to my .zshrc:

function log_write() { echo "$(date +%H:%M:%S) $*" >> ~/work_logs/$(date +%d-%m-%y)  }
function log_edit() { atom ~/work_logs/$(date +%d-%m-%y) }
function log_peek() { tail ~/work_logs/$(date +%d-%m-%y)}
alias log_arrived=' log_write arrived'
alias log_left=' log_write left'

Now I just type log_write , when I want to write to today's log, and log_peek for a quick peek at it.
If I want to write something longer I use the log_edit to write to the log using atom. Also use log_arrived and log_left to signal when I started and finished working.
Each day's log will be in it own file at the work_logs dir.

Also, if you want to log any commit messages to the work log, add this script to a post commit hook:

source ~/.zshrc
log_write 'comitted' "$(git log -1 --pretty=%B)"

1 Response
Add your response

Wow, hard core! I keep a Vim window open all day. :) This is cool.

over 1 year ago ·