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

Formattable uptime block? #1247

Closed origin-master closed 2 months ago

origin-master commented 3 years ago

For my case: I prefer not to show minutes or seconds but I want to see only hours. I usually run my computer more than an hours, and this uptime block shows seconds unit in less than an hour. That was little bothering me.

Since the uptime block is not-too-complicated to implement one (so I think you can feel free to ignore this suggestion), currently I'm using custom block for that with this script:

awk '{printf "⏰ %.1f", ($1 / 3600)}' /proc/uptime

Related code

https://github.com/greshake/i3status-rust/blob/61be770a6792f131aa75de675145757e8c72c3c1/src/blocks/uptime.rs#L85-L97

ammgws commented 3 years ago

Sure it seems reasonable to make it formattable.