visionmedia/pomo — pull request #24 by stephenmckinney (2012-12-07 00:59:20+00:00)
Title: A few updates

Most likely you're *not* still supporting this gem, but I've had fun using it and added a few features that made it more useful for myself after seeing the Pomodoro plugin for RubyMine I wanted something similar in iTerm2.

Here's the punchlist:

* Added detach mode, on by default. To get the 1.x progress bar run `pomo start -p`. Closes #1
* Added notification support for Mac OS X User Notifications on OS X 10.8+,
and libnotify for Linux. Growl continues to be supported on OS X 10.7 or earlier. Closes #23
* Added output of pomo timer to `~/.pomo_stat`.
* Added `pomo ls` as an alias to `pomo list`

The `~/.pomo_stat` feature enables Tmux status lines, etc. to read this file and display the current time left in a Pomodoro e.g.

![Screenshot](http://i.imgur.com/lqxrO.png)

![Screenshot](http://i.imgur.com/Z29q6.png)

![Screenshot](http://i.imgur.com/lRpFe.png)

in tmux.conf
```
# status bar refresh rate (seconds)
set -g status-interval 3
# right status bar
set-option -g status-right '#[bold]⡇ #H ⡇ #(~/.bin/pomo) ⡇ #(~/.bin/battery) ⡇ %b %d %I:%M%p '
```

~/.bin/pomo
```
#!/bin/sh

# Display timer as red if less than 5 mins and
# green for greater that 5 mins. 0 is not changed.
echo $(cat ~/.pomo_stat) | \
sed \
-e 's/^\([1-5]\):00/#[default]#[fg=red]\1:00#[default]#[bold]/' \
-e 's/^\([1-9][0-9]\{0,1\}\):00/#[default]#[fg=green]\1:00#[default]#[bold]/'
```