aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorÖzgür Kesim <oec@codeblau.de>2022-04-02 11:29:40 +0200
committerÖzgür Kesim <oec@codeblau.de>2022-04-02 11:29:40 +0200
commitb9011b743bb5d1aa3f80e30d598b4493898f4b4a (patch)
tree7718f56a3af5c6c29dc138dff46c0921987c5475 /main.go
parent3bde46a84b5ee1f8f20b767a6936ce95cf872d83 (diff)
choose loudspeaker icons depending on volumeHEADmaster
Diffstat (limited to 'main.go')
-rw-r--r--main.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/main.go b/main.go
index 6a09875..ed9e2ee 100644
--- a/main.go
+++ b/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
}