mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-02-21 02:55:37 -08:00
19 lines
341 B
Go
19 lines
341 B
Go
|
//go:build !darwin
|
||
|
|
||
|
package environment
|
||
|
|
||
|
import (
|
||
|
"oh-my-posh/environment/battery"
|
||
|
"time"
|
||
|
)
|
||
|
|
||
|
func (env *ShellEnvironment) BatteryState() (*battery.Info, error) {
|
||
|
defer env.Trace(time.Now(), "BatteryState")
|
||
|
info, err := battery.Get()
|
||
|
if err != nil {
|
||
|
env.Log(Error, "BatteryState", err.Error())
|
||
|
return nil, err
|
||
|
}
|
||
|
return info, nil
|
||
|
}
|