From time to time I find myself immersed in my terminal. Bouncing around in
Tmux(1.7) between vim, console and whatever else I’m doing. With my terminal
in fullscreen mode I don’t notice the power draining from my battery.
This is a fixable problem.
Tmux provides a constant status bar at the bottom of the screen. Let’s add a
battery indicator to right side of the status bar. While we’re adding that we
might as well tack on the time and date.
# status promptset -g status-right '#(~/bin/tmux_battery_charge_indicator.sh) #[bg=white,fg=colour240] %H:%M #[bg=colour240,fg=white] %Y-%m-%d 'set -g status-utf8 on
Of course for this to work we need a script that outputs an indication of how
much battery we have remaining.
Note: The script works in Moutain Lion and on linux.