summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuke Smith <luke@lukesmith.xyz>2023-02-06 17:05:16 -0500
committerLuke Smith <luke@lukesmith.xyz>2023-02-06 17:05:16 -0500
commit98ea4e0080fd6f05485baa485cefe2fd7fea9fa2 (patch)
treeb5a13d4583e9f8e4782f647b7c30cd12227382bc
parent070c613050e9149fafc8af3072218199b4588387 (diff)
downloadeibhear-98ea4e0080fd6f05485baa485cefe2fd7fea9fa2.tar.gz
eibhear-98ea4e0080fd6f05485baa485cefe2fd7fea9fa2.tar.zst
eibhear-98ea4e0080fd6f05485baa485cefe2fd7fea9fa2.zip
fix #1260, more principled volume format
-rwxr-xr-x.local/bin/statusbar/sb-volume5
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="🔊" ;;