bitsmanent / snore

sleep with feedback
MIT License
73 stars 11 forks source link

Suggestion: Add a progress bar #8

Closed sbrl closed 5 years ago

sbrl commented 6 years ago

There's quite a bit on unused space to the right of the counter. Maybe it could be filled with an ASCII progress bar?

(Also, is it possible to hide the days and hours etc. when they aren't used for a counter? They make it more difficult to visually grep what's going on.)

bitsmanent commented 6 years ago

I'm not against putting a progress bar into snore because it's not complex and add only a few SLOC. I just wonder if it's a real need or just a cool feature to have. I may decide to implement this when I'll have some free time, in the while feel free to send a patch.

You cannot toggle what snore prints without changing the source code. We may hide all the fields with zero value, this would improve things up for you?

sbrl commented 6 years ago

Hrm. I'd say it's needed to make snore really useful,as it provides a much-needed visual cue as to how much time as passed.

Ah, yeah - that would greatly improve things and cut away some of the visual noise.

I think if either were to be implemented, they should be behind flags though.

bitsmanent commented 6 years ago

I've been playing around with the code and discovered that adding command line arguments needs to refactor main(). After that we need to collects time pieces (arguments) and loop on them, instead of simply loop on argv. Alternatively, we could make a nozerofields compile-time option. There is also a glitch from 0 to 0.99 seconds where no fields are shown at all: the only output is " | ". We could hide only fields with zero precision but this sounds a bit like a workaround, not a solution.

For the progress bar it's only matter of a single function but we also need that command line arguments handling gets properly implemented. Since I'm not much interested in this, it's likely that I will not implement it myself but patches are welcome.

All of this may introduce more complexity than I would like to. I'll think about it for a while.