aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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
}