In a previous post, we introduced Watson our open source time-tracker and how we use it at TailorDev. After a few discussions with Watson’s users, it appears that Watson has two major weaknesses that needed to be addressed: i. running complex commands efficiently, and, ii. being visually notified that Watson is (not) running. Fortunately, the community took care of that by implementing shell completion and various notifiers.
Bash completion has been proposed by Christopher Arndt and it does what you expect from a command line tool completion: it completes (sic!) commands, command options, projects, tags and frame IDs. Let’s see it in action!
To install it, follow these steps:
$ mkdir $HOME/.bash_completion.d $ wget \ https://raw.githubusercontent.com/TailorDev/Watson/master/watson.completion \ -O $HOME/.bash_completion.d/watson $ echo "source $HOME/.bash_completion.d/watson" >> $HOME/.bashrc # Restart your shell or $ source $HOME/.bashrc
/etc/bash_completion.d or any path where
you store completion files.
Zsh completion is a collaborative work from Grégoire Détrez and James Dinsdale. Before having seen it in action I was a bash-guy, and this made me switch to zsh. You don’t believe me? Take a look at this:
Pretty cool, no?
This is still a work in progress, but if you cannot wait to test it, get the completion file from Grégoire’s fork via:
$ wget https://raw.githubusercontent.com/gdetrez/Watson/zsh-completion/watson.zsh-completion \ -O /usr/local/share/zsh/site-functions/_watson
Similarly to bash, the proposed path can be any path from your
Note that yout need to make sure that your zsh configuration enables
If not, add this to your
autoload -Uz compinit && compinit
Now that we have shell completion, we are able to quickly start, stop and edit Watson’s frames. Good. But, there is still a huge missing feature: how can I train myself not to forget to start or stop Watson?
Add Watson’s status to your prompt
If you want something not so intrusive, why not adding a red/green light to your prompt like the following?
To do so, follow this gist:
cron notification task
The underlying idea is pretty simple: periodically look for Watson’s status
cron FTW) and send a desktop notification to the user.
Yannick Loiseau proposed a really concise bash notifier written in bash:
Cross-platform system tray
cron strategy is simple and efficient, but unfortunately since
it depends on GNU/Linux notification libraries, it cannot be run on Mac OSX or
other non-*nix systems. After digging around for a universal notification
system, I came across the idea that a cross-platform system tray is a
relevant solution. As I am not a big fan of GTK or Qt programing, I started to
look at the Electron project and particularly
menubar, a “high level way to create
menubar desktop applications with electron”.
I have started to play with it and even if we are at the early-stage of what it could be, just for you, here is a quick preview:
As you expect the tray icon changes depending on Watson’s status and clicking on the icon gives you detailed information about the current frame and a running timer.
Please share your thoughts about these tools and do not hesitate to ping us on Twitter.