olimorris / tmux-pomodoro-plus

πŸ… Incorporate the Pomodoro technique into your tmux workflow
MIT License
274 stars 23 forks source link

Display time in MM:SS format #15

Closed PezCoder closed 1 year ago

PezCoder commented 1 year ago

Issue Details: https://github.com/olimorris/tmux-pomodoro-plus/issues/13

Before After

Done βœ…

How to test these changes?

PezCoder commented 1 year ago

About updating the status line every second

Chat gpt way - using while infinite loop

Screenshot 2023-02-06 at 2 50 41 AM

❌ Doesn't seem like a great idea, as after adding the loop completely froze my tmux

Set status interval approach - @olimorris

tmux set status-interval 1

The approach you suggested seems to be working alright for me, without any sort of lag in the tmux UI. This would mean that tmux will update the status bar every second, which is what we are looking for.

❓ I wanted to ask, where should this command be put, should we ask the users to put it in their tmux.conf - as I'm not sure if it would be wise for a plugin to globally set the status update?

olimorris commented 1 year ago

❓ I wanted to ask, where should this command be put, should we ask the users to put it in their tmux.conf - as I'm not sure if it would be wise for a plugin to globally set the status update?

I think this is probably the best way forward. I suspect that for some user's configs this could result in some lagging.

I can add a section to the readme explaining how to get additional granularity in the pomodoros: enabling the option and setting tmux set status-interval 1 in their config.

PezCoder commented 1 year ago

Updated readme & the option as per your suggestions, can you please take a look @olimorris ? - Let me know if any suggestions.

olimorris commented 1 year ago

I've just tweaked the readme a little and fixed some of the sh warnings. Can you have a final play, check I've not messed anything up and then I think we're good to go.

Really excited by this and the 1 second interval refresh has seemingly no negative performance impact for myself.

PezCoder commented 1 year ago

Nice, thank you for the changes! I just did sanity of the Pomodoro along with the break (by setting the duration to 1), for both "on" & "off" values of pomodoro_granularity_seconds

All good βœ