2022-07-05 07:27:25 -07:00
|
|
|
//go:build !darwin
|
|
|
|
|
2022-11-09 11:27:54 -08:00
|
|
|
package platform
|
2022-07-05 07:27:25 -07:00
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
2022-12-28 08:30:48 -08:00
|
|
|
|
2023-01-05 12:57:38 -08:00
|
|
|
"github.com/jandedobbeleer/oh-my-posh/src/platform/battery"
|
2022-07-05 07:27:25 -07:00
|
|
|
)
|
|
|
|
|
2022-11-09 11:27:54 -08:00
|
|
|
func (env *Shell) BatteryState() (*battery.Info, error) {
|
2023-01-16 11:58:43 -08:00
|
|
|
defer env.Trace(time.Now())
|
2022-07-05 07:27:25 -07:00
|
|
|
info, err := battery.Get()
|
|
|
|
if err != nil {
|
2023-01-16 11:58:43 -08:00
|
|
|
env.Error(err)
|
2022-07-05 07:27:25 -07:00
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return info, nil
|
|
|
|
}
|