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

Commit

Permalink
Update power checking condition
Browse files Browse the repository at this point in the history
  • Loading branch information
rashil2000 authored and JanDeDobbeleer committed Aug 27, 2020
1 parent e3262e5 commit 57d09c9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Themes/Powerlevel9k.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 57d09c9

Please sign in to comment.