choose loudspeaker icons depending on volume

This commit is contained in:
Özgür Kesim 2022-04-02 11:29:40 +02:00
parent 3bde46a84b
commit b9011b743b

12
main.go
View File

@ -37,7 +37,17 @@ func printvol(c *pulseaudio.Client) float32 {
if e != nil {
fmt.Println(e)
} else {
fmt.Printf("%d%%\n", int(100*v))
var c rune
if v < 0.1 {
c = ''
} else if v < 0.5 {
c = ''
} else if v < 0.8 {
c = ''
} else {
c = ''
}
fmt.Printf("%c % 2d%%\n", c, int(100*v))
}
return v
}