/zsh_battery_state

A plugin for zsh to display the state of battery in right-prompt.

Primary LanguagePython

zsh-battery-state by Jactry
zsh-battery-state is a plugin to display the state of battery in zsh.


1.Install oh-my-zsh

Follow the guide here:https://github.com/robbyrussell/oh-my-zsh


2.Clone zshbatterystate from GitCafé

git clone git://gitcafe.com/Jactry/zsh_battery_state.git ~/.oh-my-zsh/plugins/zsh-battery-state


3.Set zsh to support it

Add this to your ~/.zshrc :

function battery_display {
	BAT_STATE=~/.oh-my-zsh/plugins/zsh-battery-state/battery_state.py
	echo `$BAT_STATE` 2>/dev/null
}

RPROMPT='$(battery_display)'



Note:

If does not work in your zsh,please check your .zshrc and make sure it include this:

ZSH=$HOME/.oh-my-zsh
source $ZSH/oh-my-zsh.sh


Enjoy it!

And if you meet some problem when you use it please contact me.

My EMail is jactry92@gmail.com Thank you!