Last Updated: February 25, 2016
·
5.755K
· copenhas

Battery status in tmux status bar

Cool battery shell script to get the battery level:
https://github.com/richoH/dotfiles/blob/master/bin/battery

Make sure that script is in you path somewhere and then include this in your .tmux.conf

set -g status-right "#(battery Discharging)"

The #(battery Discharging) is the important part that runs the command and swaps in the output. You can mix it in with other stuff or into a different part of your status bar.

I prefer to see the amount of battery and the time in the lower right corner, so here's mine:

set -g status-right "#(battery Discharging) | #[fg=cyan]%d %b %R"

Will show something like:

83% | 15 Nov 22:10