From 06ce1a7704591163e0d7481cc57ce45a388a646c Mon Sep 17 00:00:00 2001 From: Breizh Date: Wed, 28 Mar 2018 21:50:21 +0200 Subject: [PATCH] Modification i3blocks volume --- .i3blocks/volume | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.i3blocks/volume b/.i3blocks/volume index 33c5f79..2ea6ea5 100755 --- a/.i3blocks/volume +++ b/.i3blocks/volume @@ -57,24 +57,28 @@ format() { then # TYPE_MUTE=" " # TYPE=" " - TYPE="vol " - TYPE_MUTE="vol " + # TYPE="vol " + # TYPE_MUTE="vol " + TYPE='' + TYPE_MUTE='' elif [[ $SCONTROL = "Capture" ]] then # TYPE_MUTE=" " # TYPE=" " - TYPE="mic " - TYPE_MUTE="mic " + # TYPE="mic " + # TYPE_MUTE="mic " + TYPE='' + TYPE_MUTE='' fi perl_filter='if (/.*\[(\d+%)\] (\[(-?\d+.\d+dB)\] )?\[(on|off)\]/)' perl_filter+='{CORE::say $4 eq "off" ? "' perl_filter+=$TYPE_MUTE perl_filter+=$([[ $STEP = *dB ]] && echo '$3' || echo '$1') - perl_filter+='\n\n#f2777a" : "' + perl_filter+='" : "' perl_filter+=$TYPE # If dB was selected, print that instead perl_filter+=$([[ $STEP = *dB ]] && echo '$3' || echo '$1') - perl_filter+='\n\n#99cc99"; exit}' + perl_filter+='"; exit}' perl -ne "$perl_filter" }