1
0
Fork 0
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:
Dominik Ritter 2015-11-23 00:12:52 +01:00
parent c0efe9c342
commit b316089c6b

View file

@ -211,11 +211,11 @@ prompt_aws() {
prompt_battery() { prompt_battery() {
icons[BATTERY_ICON]=$'\UE894' icons[BATTERY_ICON]=$'\UE894'
# set default values of not specified in shell # set default values of not specified in shell
[[ -z $POWERLEVEL9K_BATTERY_CHARGING ]] && POWERLEVEL9K_BATTERY_CHARGING="yellow" set_default POWERLEVEL9K_BATTERY_CHARGING "yellow"
[[ -z $POWERLEVEL9K_BATTERY_CHARGED ]] && POWERLEVEL9K_BATTERY_CHARGED="green" set_default POWERLEVEL9K_BATTERY_CHARGED "green"
[[ -z $POWERLEVEL9K_BATTERY_DISCONNECTED ]] && POWERLEVEL9K_BATTERY_DISCONNECTED="$DEFAULT_COLOR_INVERTED" set_default POWERLEVEL9K_BATTERY_DISCONNECTED "$DEFAULT_COLOR_INVERTED"
[[ -z $POWERLEVEL9K_BATTERY_LOW_THRESHOLD ]] && POWERLEVEL9K_BATTERY_LOW_THRESHOLD=10 set_default POWERLEVEL9K_BATTERY_LOW_THRESHOLD 10
[[ -z $POWERLEVEL9K_BATTERY_LOW_COLOR ]] && POWERLEVEL9K_BATTERY_LOW_COLOR="red" 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 fg_color="" || local fg_color="%F{$POWERLEVEL9K_BATTERY_FOREGROUND}"
[[ -z $POWERLEVEL9K_BATTERY_FOREGROUND ]] && local conn="$DEFAULT_COLOR_INVERTED" || local conn="$POWERLEVEL9K_BATTERY_FOREGROUND" [[ -z $POWERLEVEL9K_BATTERY_FOREGROUND ]] && local conn="$DEFAULT_COLOR_INVERTED" || local conn="$POWERLEVEL9K_BATTERY_FOREGROUND"