Modification i3blocks volume
This commit is contained in:
parent
d6605642be
commit
06ce1a7704
1 changed files with 10 additions and 6 deletions
|
@ -57,24 +57,28 @@ format() {
|
|||
then
|
||||
# TYPE_MUTE=" "
|
||||
# TYPE=" "
|
||||
TYPE="vol "
|
||||
TYPE_MUTE="vol "
|
||||
# TYPE="vol "
|
||||
# TYPE_MUTE="vol "
|
||||
TYPE='<span foreground=\"#99CC99\">'
|
||||
TYPE_MUTE='<span foreground=\"#F2777A\">'
|
||||
elif [[ $SCONTROL = "Capture" ]]
|
||||
then
|
||||
# TYPE_MUTE=" "
|
||||
# TYPE=" "
|
||||
TYPE="mic "
|
||||
TYPE_MUTE="mic "
|
||||
# TYPE="mic "
|
||||
# TYPE_MUTE="mic "
|
||||
TYPE='<span foreground=\"#99CC99\">'
|
||||
TYPE_MUTE='<span foreground=\"#F2777A\">'
|
||||
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+='</span>" : "'
|
||||
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+='</span>"; exit}'
|
||||
perl -ne "$perl_filter"
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue