i3blocks icon indicating copy to clipboard operation
i3blocks copied to clipboard

Separator setting not respecting non-rendered blocks

Open allgreed opened this issue 5 years ago • 2 comments

My situation:

I have 2 blocks side-by-side one is rendering, the other is not [they're memory indicators - one showing RAM and the other swap and I don't have any swap on the current machine].

Relevant config:

[memory]
label= 
command=~/.scripts/blocks/memory
interval=15
separator=false

[memory]
label= SWAP
instance=swap
command=~/.scripts/blocks/memory
interval=15

[any block really]
# but in my case it's disk

I'd like this to happen:

2020-10-24-01-35-25_263x32 Because the separator is false on memory it should apply to the non-rendered swap

But this happens:

2020-10-24-01-35-47_292x43

Potential workarounds

  • puting the block that's always there second and optional blocks first - but I'd rather not do that as I want to be in control of the order of my blocks, not limited by the software
  • combining blocks into groups (so that they're one block in the config), like creating another block script that combines the (in this example) two memory blocks - seams rather backwards as the labels would have to passed via env vars to this block, what if the blocks have different intervals, etc...

Questions

  • Can you think of other workarounds that sound more sensible than what I was able to come up with?
  • Would it be sensible for separator=false to work the propsed way? I might implement it, but would really like to hear your opinion first ;)

allgreed avatar Oct 24 '20 00:10 allgreed

Unfortunately this is a limitation of the i3bar protocol which draws the separator after the block. You may draw an arbitrary separator with a static block like this (full_text is a space) after your swap block:

[separator]
full_text= 
separator=true

There is also a more complex example in the FAQ.

vivien avatar Dec 28 '22 05:12 vivien

Supporting multi blocks output is something I'm evaluating, but still worried that it would bring more complexity than value I must say.

vivien avatar Dec 28 '22 05:12 vivien