mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-12-18 05:40:07 +00:00
added time remaining support to battery segment on Linux
This commit is contained in:
parent
3b2971b344
commit
ff3f6b8e83
2 changed files with 5 additions and 1 deletions
|
@ -116,7 +116,7 @@ with the environment variables detailed below with their default values.
|
||||||
|
|
||||||
In addition to the above it supports standard _FOREGROUND value without affecting the icon color
|
In addition to the above it supports standard _FOREGROUND value without affecting the icon color
|
||||||
|
|
||||||
Supports both OS X and Linux(time remaining is only output in OS X)
|
Supports both OS X and Linux(time remaining requires the acpi program on Linux)
|
||||||
|
|
||||||
|
|
||||||
##### context
|
##### context
|
||||||
|
|
|
@ -670,6 +670,10 @@ prompt_battery() {
|
||||||
if [[ ! $connected =~ true ]]; then
|
if [[ ! $connected =~ true ]]; then
|
||||||
[[ $bat_percent -lt $POWERLEVEL9K_BATTERY_LOW_THRESHOLD ]] && local conn="%F{$POWERLEVEL9K_BATTERY_LOW_COLOR}" || local conn="%F{$POWERLEVEL9K_BATTERY_DISCONNECTED}"
|
[[ $bat_percent -lt $POWERLEVEL9K_BATTERY_LOW_THRESHOLD ]] && local conn="%F{$POWERLEVEL9K_BATTERY_LOW_COLOR}" || local conn="%F{$POWERLEVEL9K_BATTERY_DISCONNECTED}"
|
||||||
fi
|
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
|
fi
|
||||||
|
|
||||||
# display prompt_segment
|
# display prompt_segment
|
||||||
|
|
Loading…
Reference in a new issue