choose loudspeaker icons depending on volume
This commit is contained in:
parent
3bde46a84b
commit
b9011b743b
12
main.go
12
main.go
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user