i3blocks-contrib icon indicating copy to clipboard operation
i3blocks-contrib copied to clipboard

bandwidth3 does not accept properties in the config file

Open qazip opened this issue 5 years ago • 8 comments

Expected behavior

I have the following code in my i3blocks config file:

[bandwidth3]
command=/usr/lib/i3blocks/bandwidth3/bandwidth3
interval=persist
color=#33FFFF
color=#00CCCC
markup=pango
# LABEL=<span font='FontAwesome'>  </span>
LABEL=blabla
unit=MB

I would expect both the units and label of the bandwidth block to represent what I have in the config file, namely "MB" and "blabla". This is not happening, it seems like it is hard coded in the bandwidth3 script?

I am using i3blocks 1.5-3.

qazip avatar Oct 04 '19 09:10 qazip

according to what I see in 'bandwidth3' code: parameter UNIT must be capped. unit is an internal variable that is set to either UNIT's value or a default 'Mb' regardless of unit's initial value.

'LABEL' won't work, that's true.

skidnik avatar Oct 08 '19 12:10 skidnik

Thanks for replying @skidnik. What do you mean by "capped"? I tried doing "UNIT=MB" and it still doesn't work.

qazip avatar Oct 09 '19 05:10 qazip

@qazip

What do you mean by "capped"?

Yeah, sorry for weird language, means name of variable must be uppercase. There's also a quite long case statement in the block script taking in account all variants like 'Mb', 'MB', 'mb' and more, so the value may not be that strict.

Check the bandwidth3 code, it's bash and some awk, may become more clear how it works.

skidnik avatar Oct 09 '19 07:10 skidnik

Well yes, but I tried doing "UNIT=MB" and it still doesn't work. What am I doing wrong? Does it work correctly on your side?

qazip avatar Oct 15 '19 13:10 qazip

Have you restarted i3 after changing the i3blocks.conf, you need to in order to apply config changes to the subject block as it's a persistent one.

skidnik avatar Oct 16 '19 09:10 skidnik

Yes, I have restarted i3 after making the changes. It doesn't work.

qazip avatar Oct 16 '19 16:10 qazip

Yes, I have restarted i3 after making the changes. It doesn't work.

I am out of ideas now. On my side the blocklet responds correctly to both 'LABEL' and 'UNIT' variables' changes.

i3blocks 1.5, Fedora 30.

skidnik avatar Oct 16 '19 16:10 skidnik

I have same problem too.

LinArcX avatar Nov 30 '19 09:11 LinArcX