diff options
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 |
commit | b9011b743bb5d1aa3f80e30d598b4493898f4b4a (patch) | |
tree | 7718f56a3af5c6c29dc138dff46c0921987c5475 | |
parent | 3bde46a84b5ee1f8f20b767a6936ce95cf872d83 (diff) |
-rw-r--r-- | main.go | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -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 } |