Watson icon indicating copy to clipboard operation
Watson copied to clipboard

Status: elapsed time in minutes, not humanize()

Open raphaelfournier opened this issue 5 years ago • 6 comments

I worked on a widget for the AwesomeWM window manager (see my Github repo), which displays watson's status with an icon (if a frame is started, it's a "play" icon, if not it's a "stop" icon, like a music player), surrounded by a (partial) circle which is a (circular) progress bar (reaching the full circle after an hour). 2019-05-13-174115_3000x1920_scrot

I needed the value of the spent time in the frame, but parsing the result of "humanize()" (given by the status command) is not very convenient. I copied the current flag code and wrote a slightly different version, which outputs the duration with a single number, in minutes (which could then be tweaked in the widget to account for hours or days).

A better version would probably merge the -e and -m flag to allow a formatting string.

raphaelfournier avatar May 13 '19 15:05 raphaelfournier

A better version would probably merge the -e and -m flag to allow a formatting string.

Yep.

jmaupetit avatar May 17 '19 17:05 jmaupetit

Hey man, did you find some clean solution to this? I also have this inconvenience in my polybar module

0x7b1 avatar Jun 03 '19 18:06 0x7b1

Well, the solution that I propose is clean, even if it adds a new flag. So, for now, I think it could be accepted as is. Or, if I have to find time to merge -e and -m flags, it will have to wait a few weeks, probably.

raphaelfournier avatar Jun 04 '19 10:06 raphaelfournier

We'll wait for it then :wink:

jmaupetit avatar Jun 05 '19 09:06 jmaupetit

It would be nice to have flags -h, -H, --human-readable, --no-human-readable in line with the rest of the interface and other tools. This flag would generalise better to other situations where, for example uuids are shortened for human consumption.

For maximum non-human-readability and other reasons, the time should be returned in seconds.

jmkerr avatar Jul 09 '19 17:07 jmkerr

It would be nice to have flags -h, -H, --human-readable, --no-human-readable in line with the rest of the interface and other tools. This flag would generalise better to other situations where, for example uuids are shortened for human consumption.

You're right, it's a great idea. The -h flag may, however, conflict with -h, --help, we'll have to be careful.

For maximum non-human-readability and other reasons, the time should be returned in seconds.

You're right again, it was very hackish to have the time returned in minutes, seconds is way better.

raphaelfournier avatar Jul 10 '19 07:07 raphaelfournier