mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-11-25 21:40:08 +00:00
Make use of set_default method for better code readability.
This commit is contained in:
parent
c0efe9c342
commit
b316089c6b
1 changed files with 5 additions and 5 deletions
|
@ -211,11 +211,11 @@ prompt_aws() {
|
|||
prompt_battery() {
|
||||
icons[BATTERY_ICON]=$'\UE894'
|
||||
# set default values of not specified in shell
|
||||
[[ -z $POWERLEVEL9K_BATTERY_CHARGING ]] && POWERLEVEL9K_BATTERY_CHARGING="yellow"
|
||||
[[ -z $POWERLEVEL9K_BATTERY_CHARGED ]] && POWERLEVEL9K_BATTERY_CHARGED="green"
|
||||
[[ -z $POWERLEVEL9K_BATTERY_DISCONNECTED ]] && POWERLEVEL9K_BATTERY_DISCONNECTED="$DEFAULT_COLOR_INVERTED"
|
||||
[[ -z $POWERLEVEL9K_BATTERY_LOW_THRESHOLD ]] && POWERLEVEL9K_BATTERY_LOW_THRESHOLD=10
|
||||
[[ -z $POWERLEVEL9K_BATTERY_LOW_COLOR ]] && POWERLEVEL9K_BATTERY_LOW_COLOR="red"
|
||||
set_default POWERLEVEL9K_BATTERY_CHARGING "yellow"
|
||||
set_default POWERLEVEL9K_BATTERY_CHARGED "green"
|
||||
set_default POWERLEVEL9K_BATTERY_DISCONNECTED "$DEFAULT_COLOR_INVERTED"
|
||||
set_default POWERLEVEL9K_BATTERY_LOW_THRESHOLD 10
|
||||
set_default POWERLEVEL9K_BATTERY_LOW_COLOR "red"
|
||||
[[ -z $POWERLEVEL9K_BATTERY_FOREGROUND ]] && local fg_color="" || local fg_color="%F{$POWERLEVEL9K_BATTERY_FOREGROUND}"
|
||||
[[ -z $POWERLEVEL9K_BATTERY_FOREGROUND ]] && local conn="$DEFAULT_COLOR_INVERTED" || local conn="$POWERLEVEL9K_BATTERY_FOREGROUND"
|
||||
|
||||
|
|
Loading…
Reference in a new issue