Added battery bar into my theme

This commit is contained in:
Noon Silk 2012-01-14 20:54:09 +11:00
commit e31d34a747

View file

@ -34,7 +34,7 @@ return_code_enabled="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
return_code_disabled="%{$fg[magenta]%}%D{%a %b %d}%{$reset_color%}" return_code_disabled="%{$fg[magenta]%}%D{%a %b %d}%{$reset_color%}"
return_code=$return_code_disabled return_code=$return_code_disabled
RPROMPT='${return_code}' RPROMPT='${return_code} $(battery_charge)'
function accept-line-or-clear-warning () { function accept-line-or-clear-warning () {
if [[ -z $BUFFER ]]; then if [[ -z $BUFFER ]]; then
@ -46,5 +46,10 @@ function accept-line-or-clear-warning () {
fi fi
zle accept-line zle accept-line
} }
function battery_charge () {
python ~/bin/scripts/batstate.py 2>/dev/null
}
zle -N accept-line-or-clear-warning zle -N accept-line-or-clear-warning
bindkey '^M' accept-line-or-clear-warning bindkey '^M' accept-line-or-clear-warning