From 4649f24b767c716f5d3c3b57dddc9796c385d8e8 Mon Sep 17 00:00:00 2001 From: decantr Date: Wed, 4 Sep 2019 20:05:28 +0100 Subject: [PATCH] volume information conform with i3-status style * icon now displays on the left of the icon, matching other bar elements * stereo speakers do not cause 2 sets of icons * if output is muted, only the mute icon is displayed --- .local/bin/dwmbar | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/dwmbar b/.local/bin/dwmbar index 2711dcce..9e0f1120 100755 --- a/.local/bin/dwmbar +++ b/.local/bin/dwmbar @@ -39,7 +39,7 @@ status() { \ # Get the volume of ALSA's master volume output. Show an icon if or # not muted. - amixer get Master | grep -o "[0-9]*%\|\[on\]\|\[off\]" | sed "s/\[on\]//;s/\[off\]//" + amixer get Master | grep -o "[0-9]*%\|\[on\]\|\[off\]" | tr '\n' ' ' | sed -e '/off/c' -e 's/\[on\]//' | awk '{print $2 " " $1}' | xargs echo "$delim"