i3status-rust icon indicating copy to clipboard operation
i3status-rust copied to clipboard

Any way to reuse blocks or define variables?

Open frostyfalls opened this issue 1 week ago • 3 comments

i3status-rs has been fantastic for me, and works much better than any other solution I had before. However, I'm not sure if there's a way to save blocks or parts of blocks and reuse them, sort of like how YAML has anchors.

Take my 2 battery blocks for example:

[[block]]
block = "battery"
device = "BAT0"
format = "BAT0 $percentage{ ($time_remaining.dur(hms:true))|}"
full_format = "BAT1 $percentage"
missing_format = ""
interval = 60

[[block]]
block = "battery"
device = "BAT1"
format = "BAT1 $percentage{ ($time_remaining.dur(hms:true))|}"
full_format = "BAT1 $percentage"
missing_format = ""
interval = 60

Minus the device and format, they're identical. Is there a way to reuse the battery block without duplicating it manually?

This is sort of nitpicky, but I wanted to ask. Thanks so much.

frostyfalls avatar Feb 18 '25 19:02 frostyfalls