Skip to content
This repository was archived by the owner on Feb 16, 2021. It is now read-only.

Commit 57d09c9

Browse files
rashil2000JanDeDobbeleer
authored andcommitted
Update power checking condition
1 parent e3262e5 commit 57d09c9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Themes/Powerlevel9k.psm1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ function Write-Theme {
5757
# Update battery icon based on status and charge (works only on Windows)
5858
if ($env:OS -eq 'Windows_NT') {
5959
$charge = (Get-WmiObject win32_battery).EstimatedChargeRemaining
60-
if ((Get-WmiObject -Class batterystatus -Namespace root\wmi).Charging) {
61-
if ($charge -eq 100) { $batteryhex = 0xf582 }
62-
else { $batteryhex = 0xf583 }
60+
if ((Get-WmiObject -Class batterystatus -Namespace root\wmi).PowerOnline) {
61+
if ((Get-WmiObject -Class batterystatus -Namespace root\wmi).Charging) { $batteryhex = 0xf583 }
62+
else { $batteryhex = 0xf582 }
6363
}
6464
else {
6565
[int]$level = $charge / 10

0 commit comments

Comments
 (0)