aboutsummaryrefslogtreecommitdiff
path: root/powerlevel9k.zsh-theme
diff options
context:
space:
mode:
authorrjorgenson <rjorgenson@gmail.com>2015-10-19 05:48:45 +0300
committerrjorgenson <rjorgenson@gmail.com>2015-10-19 05:48:45 +0300
commitff3f6b8e833946a8e98352ceb15e8eb5682e2b69 (patch)
tree94cbbd340b3ff8aa9a34b9b2a48db7db1be32ef8 /powerlevel9k.zsh-theme
parent3b2971b344e668a57edd8f199dd9681fd0a2f734 (diff)
added time remaining support to battery segment on Linux
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rwxr-xr-xpowerlevel9k.zsh-theme4
1 files changed, 4 insertions, 0 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index eefeaa5b..bb24e60a 100755
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -670,6 +670,10 @@ prompt_battery() {
if [[ ! $connected =~ true ]]; then
[[ $bat_percent -lt $POWERLEVEL9K_BATTERY_LOW_THRESHOLD ]] && local conn="%F{$POWERLEVEL9K_BATTERY_LOW_COLOR}" || local conn="%F{$POWERLEVEL9K_BATTERY_DISCONNECTED}"
fi
+ if [[ -f /usr/bin/acpi ]]; then
+ [[ $(acpi | awk '{ print $5 }') =~ rate ]] && local tstring="..." || local tstring=${(f)$(date -u -d @$(acpi | awk '{ print $5 }' | sed s/://g) +%k:%M)}
+ fi
+ [[ ! -z $tstring ]] && local remain=" ($tstring)"
fi
# display prompt_segment