commit 028570a945fa8d09078dc6aef6bf54973618a142
parent 8f7d16db738036324aa03d81f0f54b0b2ed5e7f6
Author: Alex Balgavy <alexander.balgavy@spaceapplications.com>
Date: Thu, 18 Apr 2024 18:56:10 +0200
dwmblock-volume: fix output
Diffstat:
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/scripts/dwmblock-volume b/scripts/dwmblock-volume
@@ -53,12 +53,11 @@ mic="$(pactl get-source-volume "$source" \
| awk -v mic_icon="$mic_icon" -F ' / ' '{
gsub(" ", "", $2);
gsub(" ", "", $4);
- if ($2 == $4) {
+ if (NF <= 4 || $2 == $4) {
printf("%s %s", mic_icon, $2);
}
else {
- printf("%s %s %s", mic_icon, $2);
+ printf("%s %s %s", mic_icon, $2,$4);
}
}')"
printf "%s %s%s" "$volume" "$mic" "$recording"
-