oh-my-posh/src/platform/shell_windows_nix.go

20 lines
310 B
Go
Raw Normal View History

//go:build !darwin
2022-11-09 11:27:54 -08:00
package platform
import (
"time"
2022-12-28 08:30:48 -08:00
"github.com/jandedobbeleer/oh-my-posh/src/platform/battery"
)
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())
info, err := battery.Get()
if err != nil {
2023-01-16 11:58:43 -08:00
env.Error(err)
return nil, err
}
return info, nil
}