aboutsummaryrefslogtreecommitdiff
path: root/powerlevel9k.zsh-theme
diff options
context:
space:
mode:
authorDominik Ritter <dritter03@googlemail.com>2015-11-23 02:12:52 +0300
committerDominik Ritter <dritter03@googlemail.com>2015-11-23 02:12:52 +0300
commitb316089c6bca112c88f6030f4f5b70d4236f2dbc (patch)
tree1bea8cd7409ab72b70e916dfc123b2694dd7fe4a /powerlevel9k.zsh-theme
parentc0efe9c342450b4d20488633a2e1bfd1e30ce7e0 (diff)
Make use of set_default method for better code readability.
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rwxr-xr-xpowerlevel9k.zsh-theme10
1 files changed, 5 insertions, 5 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index 6fec74ca..1f0069c3 100755
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -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"