fix(battery): disable for WSL

charge_full_design and charge_full does not exists in WSL
This commit is contained in:
lnu 2022-02-07 08:02:02 +01:00 committed by Jan De Dobbeleer
parent b9916f559a
commit 632e495141
2 changed files with 8 additions and 0 deletions

View file

@ -6,6 +6,10 @@ sidebar_label: Battery
## What
:::caution
The segment is not supported and automatically disabled on windows when WSL 1 is detected. Works fine with WSL 2.
:::
Battery displays the remaining power percentage for your battery.
## Sample Configuration

View file

@ -32,6 +32,10 @@ func (b *Battery) Template() string {
}
func (b *Battery) Enabled() bool {
if !b.env.IsWsl2() {
return false
}
batteries, err := b.env.BatteryInfo()
if !b.enabledWhileError(err) {