From 57d09c975a454cd47acb3264a5f0060040a4765c Mon Sep 17 00:00:00 2001 From: Rashil Gandhi <46838874+rashil2000@users.noreply.github.com> Date: Mon, 24 Aug 2020 00:14:48 +0530 Subject: [PATCH] Update power checking condition --- Themes/Powerlevel9k.psm1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Themes/Powerlevel9k.psm1 b/Themes/Powerlevel9k.psm1 index c1dd1175..dd3e056a 100644 --- a/Themes/Powerlevel9k.psm1 +++ b/Themes/Powerlevel9k.psm1 @@ -57,9 +57,9 @@ function Write-Theme { # Update battery icon based on status and charge (works only on Windows) if ($env:OS -eq 'Windows_NT') { $charge = (Get-WmiObject win32_battery).EstimatedChargeRemaining - if ((Get-WmiObject -Class batterystatus -Namespace root\wmi).Charging) { - if ($charge -eq 100) { $batteryhex = 0xf582 } - else { $batteryhex = 0xf583 } + if ((Get-WmiObject -Class batterystatus -Namespace root\wmi).PowerOnline) { + if ((Get-WmiObject -Class batterystatus -Namespace root\wmi).Charging) { $batteryhex = 0xf583 } + else { $batteryhex = 0xf582 } } else { [int]$level = $charge / 10