diff options
Diffstat (limited to '.local')
| -rwxr-xr-x | .local/bin/statusbar/volume | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/.local/bin/statusbar/volume b/.local/bin/statusbar/volume index ef9fe17..f60684e 100755 --- a/.local/bin/statusbar/volume +++ b/.local/bin/statusbar/volume @@ -2,6 +2,7 @@ import subprocess import re import os +import sys block = os.getenv("BLOCK_BUTTON") @@ -77,17 +78,14 @@ for sink in sinks.values(): mute = sink["Mute"] == "yes" +format_string = "%i" +if len(sys.argv) > 1: + format_string = sys.argv[1] if vol is None or mute: - print("婢 [ Mute ] 0%") - quit(0) - -if vol > 70: - icon = "墳 " -elif vol > 30: - icon = "奔 " + vol = "Muted" else: - icon = "奄 " + v = vol // 10 + +print(format_string % vol) -v = vol // 10 -print(f"{icon}[{'*' * v}{' ' * (10 - v)}] {str(vol).rjust(3, ' ')}%") |