Watson
Watson copied to clipboard
Status: elapsed time in minutes, not humanize()
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).
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.
A better version would probably merge the -e and -m flag to allow a formatting string.
Yep.
Hey man, did you find some clean solution to this? I also have this inconvenience in my polybar module
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.
We'll wait for it then :wink:
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.
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.