aboutsummaryrefslogtreecommitdiff
path: root/internal/p10k.zsh
diff options
context:
space:
mode:
authorwzy <32936898+Freed-Wu@users.noreply.github.com>2021-03-07 11:11:28 +0300
committerGitHub <noreply@github.com>2021-03-07 11:11:28 +0300
commit6d545d5dd06bd85bbfda5cc8fd7938aee4b79d55 (patch)
treea7ecc736556062efee9449366d28181f384fd244 /internal/p10k.zsh
parent3920940ea84f6fba767cbed3fe6ba0653411c706 (diff)
Fix #1286 (#1288)
Diffstat (limited to 'internal/p10k.zsh')
-rw-r--r--internal/p10k.zsh6
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/p10k.zsh b/internal/p10k.zsh
index 43fa8336..b78ecd14 100644
--- a/internal/p10k.zsh
+++ b/internal/p10k.zsh
@@ -1341,10 +1341,10 @@ _p9k_prompt_battery_set_args() {
if _p9k_read_file $dir/(power|current)_now(N) && (( $#_p9k__ret < 9 )); then
(( power_now += ${pow::=$_p9k__ret} ))
fi
- if _p9k_read_file $dir/(energy|charge)_now(N); then
- (( energy_now += _p9k__ret ))
- elif _p9k_read_file $dir/capacity(N); then
+ if _p9k_read_file $dir/capacity(N); then
(( energy_now += _p9k__ret * full / 100. + 0.5 ))
+ elif _p9k_read_file $dir/(energy|charge)_now(N); then
+ (( energy_now += _p9k__ret ))
fi
_p9k_read_file $dir/status(N) && local bat_status=$_p9k__ret || continue
[[ $bat_status != Full ]] && is_full=0