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