mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-11-09 20:44:03 -08:00
parent
284f2cbccf
commit
b0c7e66ae1
|
@ -2,6 +2,7 @@ package main
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"math"
|
||||
|
||||
"github.com/distatus/battery"
|
||||
)
|
||||
|
@ -42,6 +43,7 @@ func (b *batt) enabled() bool {
|
|||
return true
|
||||
}
|
||||
batteryPercentage := bt.Current / bt.Full * 100
|
||||
batteryPercentage = math.Min(100, batteryPercentage)
|
||||
percentageText := fmt.Sprintf("%.0f", batteryPercentage)
|
||||
var icon string
|
||||
var colorPorperty Property
|
||||
|
|
Loading…
Reference in a new issue