diff options
| author | Luke Smith <luke@lukesmith.xyz> | 2023-02-06 17:05:16 -0500 |
|---|---|---|
| committer | Luke Smith <luke@lukesmith.xyz> | 2023-02-06 17:05:16 -0500 |
| commit | 98ea4e0080fd6f05485baa485cefe2fd7fea9fa2 (patch) | |
| tree | b5a13d4583e9f8e4782f647b7c30cd12227382bc /.local/bin/statusbar | |
| parent | 070c613050e9149fafc8af3072218199b4588387 (diff) | |
| download | eibhear-98ea4e0080fd6f05485baa485cefe2fd7fea9fa2.tar.gz eibhear-98ea4e0080fd6f05485baa485cefe2fd7fea9fa2.tar.zst eibhear-98ea4e0080fd6f05485baa485cefe2fd7fea9fa2.zip | |
fix #1260, more principled volume format
Diffstat (limited to '.local/bin/statusbar')
| -rwxr-xr-x | .local/bin/statusbar/sb-volume | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/.local/bin/statusbar/sb-volume b/.local/bin/statusbar/sb-volume index 52999f4..acdf7a9 100755 --- a/.local/bin/statusbar/sb-volume +++ b/.local/bin/statusbar/sb-volume @@ -19,14 +19,15 @@ vol="$(wpctl get-volume @DEFAULT_AUDIO_SINK@)" [ "$vol" != "${vol%\[MUTED\]}" ] && echo 🔇 && exit vol="${vol#Volume: }" + split() { # For ommiting the . without calling and external program. IFS=$2 set -- $1 printf '%s' "$@" } -vol="$(split "$vol" ".")" -vol="${vol##0}" + +vol="$(printf "%.0f" "$(split "$vol" ".")")" case 1 in $((vol >= 70)) ) icon="🔊" ;; |
