mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-02 02:19:06 +01:00
Added battery bar into my theme
This commit is contained in:
parent
242612d745
commit
e31d34a747
1 changed files with 6 additions and 1 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue