Skip to content
Visual bars representing battery status for zsh
Latest commit cdec01d Mar 31, 2011 @MasseR Update readme
Failed to load latest commit information.
Battery.hs Handle printing properly Mar 21, 2011
Color.hs More descriptive names Nov 1, 2010
Files.hs Handle printing properly Mar 21, 2011
LICENSE Add license Mar 31, 2011
Makefile Compile with -O2 Mar 21, 2011
README.markdown Update readme Mar 31, 2011
Setup.hs Cabalify Mar 31, 2011
Symbols.hs Don't replicate colors Sep 10, 2010
zsh-battery.cabal Cabalify Mar 31, 2011


Battery bars

The only thing this software does is print a colored output of triangles colored red, yellow or green. This is a visual representation of your battery status. Green means power left, yellow means power used. If there's less than 10% of energy left, the entire bar turns red.


Zsh allows putting prompts to the right side of the terminal, which can be updated every time the line changes.

By putting setopt prompt_subst to your .zshrc file, the prompts are automatically updated with every change. Without it, they would be rendered once and reused while the terminal is open.

Finish it off by putting RPROMPT="\$(battery)" to your .zshrc where battery is the path to the executable. I have renamed mine from Battery to battery and copied it to $HOME/bin which is in $PATH.

Something went wrong with that request. Please try again.