i3status-rust
i3status-rust copied to clipboard
Any way to reuse blocks or define variables?
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.
There's not currently a way to do this.
Gotcha, thanks; should this be closed?
It could be implemented somehow, but I'm not convinced it is worth it.
I'm not sure that this would be worth it. I'll close this, but if you decide you/anyone else want to tackle this issue it can be reopened.