I3status-rust: Native theme

Created on 3 May 2018  路  13Comments  路  Source: greshake/i3status-rust

In other words no theme at all.
Let i3bar itself choose the default colors and draw separator.

I.e. do not produce color, background values and use native i3bar separators instead of "| " blocks.

enhancement help wanted

Most helpful comment

Works great - thanks!

All 13 comments

Doesn't theme.overrides solve your problem?

No. I can modify colors and separators using overrides, but I can't disable them at all.


The following config:

[[block]]
block = "cpu"

[[block]]
block = "load"

[[block]]
block = "time"

Produces the following output:
[{"background":"#000000","color":"#a9a9a9","full_text":"| ","separator":false,"separator_block_width":0},{"background":"#000000","color":"#93a1a1","full_text":" CPU 23% ","separator":false,"separator_block_width":0},{"background":"#000000","color":"#a9a9a9","full_text":"| ","separator":false,"separator_block_width":0},{"background":"#000000","color":"#93A1A1","full_text":" LOAD 0.26 ","separator":false,"separator_block_width":0},{"background":"#000000","color":"#a9a9a9","full_text":"| ","separator":false,"separator_block_width":0},{"background":"#000000","color":"#93a1a1","full_text":" Fri 04/05 00:19 ","name":"2f921bd715b74529945f341478714217","separator":false,"separator_block_width":0}]

But what I want is:
[{"full_text":" CPU 23% "},{"full_text":" LOAD 0.26 "},{"full_text":" Fri 04/05 00:19 ","name":"2f921bd715b74529945f341478714217"}]

This is currently a limitation of how the implementation works, so it's not simple to change by any measure. But I am sympathetic to the general aim, so I will leave it open. What would need to change is composition of fields on the block object we are serializing to JSON.

fwiw - it's safe to pass null color values to i3. Ex.

[{"background":null,"color":null,"full_text":"| ","separator":false,"separator_block_width":0},

@nvllsvm Does that result in i3 using default values for those colours or just have no colour at all?

Afaik it's "default" which means transparent background (= bar color) and white text. Not sure how applicable this is to this issue though, since

a) the current color system does not support null values, so we'd have to change a bunch of things anyway
b) It doesn't solve the separator issue at all

In that case we can't use that since my interpretation of the OP is that they want it to use the colours specified in their i3bar config

Yes this is definitely something that would require a bunch of work.

Since it's quite an old issue - is there still demand for this?

@xzfc @nvllsvm

@GladOSkar Yes - this was a blocker for me to use i3status-rust.

I just had another look at the code and while it's gonna be nasty it's probably manageable. I'll see what i can do next week.

Dealing with the theme config might be a pain unless the current theme info is available at the place where we print the blocks. Then we can just special case it.

See #938 for an implementation suggestion. @nvllsvm @xzfc testing and feedback would be appreciated

Works great - thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

concatime picture concatime  路  4Comments

Dieterbe picture Dieterbe  路  4Comments

Thra11 picture Thra11  路  6Comments

yawpitch picture yawpitch  路  4Comments

ellsclytn picture ellsclytn  路  6Comments