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

Battery: add more examples to the docs

Open tsymalla opened this issue 2 years ago • 2 comments

Previously (in a build from around mid of May), my i3status-rust setup was showing the battery leftover time via {time} correctly. However, now in v0.30, with $time it does not show anything anymore, and it takes a bit of time to display the percentage initially.

[[block]]
block = "battery"
format = "$percentage|N/A $time"
device = "DisplayDevice"
driver = "upower"

tsymalla avatar Jun 25 '22 18:06 tsymalla

This should work:

[[block]]
block = "battery"
format = "$percentage $time|N/A"
device = "DisplayDevice"
driver = "upower"

The problem was that $time was after |. This means that format was split into two parts: $percentage and N/A $time. The second one displays only when the first one fails.

MaxVerevkin avatar Jun 25 '22 19:06 MaxVerevkin

Thanks. Initially, I did not use the pipe symbol either, and it didn't work. This one works. I suggest adding more samples to the documentation.

tsymalla avatar Jun 26 '22 05:06 tsymalla

701f70588c67a33e2f895b20efdd35411c0c2a2c

ammgws avatar Feb 01 '23 16:02 ammgws