greshake / i3status-rust

Very resourcefriendly and feature-rich replacement for i3status, written in pure Rust
GNU General Public License v3.0
2.88k stars 475 forks source link

formatter: Adding support for seconds/minutes/hours #1332

Closed ammgws closed 2 months ago

ammgws commented 3 years ago

Adding support for seconds/minutes/hours

_Originally posted by @SebTM in https://github.com/greshake/i3status-rust/issues/1254

littlesum commented 2 years ago

You can mod by yourself

ammgws commented 2 years ago

Are you talking about this?

There is already a "seconds" unit, so we can add units like "hours", "days" etc. But to achieve formatting like "01:12" (I guess) we will have to also add "special" units like "time" and "date_time" or something like that.

For example, if placeholder var has a value of 1 hour 25 minutes, then Formatting string Result
"{var*h}" 1.42h
"{var*m}" 85m
"{var*s}" 5100s
"{var*time}" 01:25

Originally posted by @MaxVerevkin in https://github.com/greshake/i3status-rust/issues/1254#issuecomment-860555516