kantord / i3-gnome-pomodoro

:tomato: Integrate gnome-pomodoro into i3
GNU General Public License v3.0
228 stars 16 forks source link

Auto continue after break #8

Open flanaras opened 6 years ago

flanaras commented 6 years ago

Hello,

I would like to ask if there is meant to be an auto continue function after breaks as it is while running on gnome. After the break time has passed the pomodoro doesn't start again by itself. It is so or do I have a problem on my system?

i3 version 4.14.1 (2017-09-24) © 2009 Michael Stapelberg and contributors Pomodoro 0.13.4

Philip

kantord commented 6 years ago

Hello,

that's indeed how it's designed to behave. I usually leave my desk during the break, and don't return in 5 minutes sharp. Thence designing it to auto-continue didn't make much sense to me (I don't want to return to a Pomodoro that has been running for a minute or two already). However if this feature would be useful to you, I'll be glad to accept a pull request ;-)

Do you have a suggestion for a possible implementation?

flanaras commented 6 years ago

Thanks for your response,

Yes I definitely agree with you. I was thinking something like the way it runs on gnome, that i has an overlay and listens for any keyboard or mouse events and after that it starts the next pomodoro. I don't know why it doesn't work like that by default like that on i3.

kantord commented 6 years ago

I don't know why it doesn't work like that by default like that on i3.

Do you mean gnome-pomodoro resumes automatically that way under gnome? I've only tried it with i3

flanaras commented 6 years ago

Yes, indeed that is the default behavior.

kantord commented 6 years ago

wow, I didn't know. I took a glimpse at gnome-pomodoro's source and I found this: https://github.com/codito/gnome-pomodoro/blob/797be15a5c674a663c7b256f28398a709946c69b/plugins/gnome/gnome-plugin.vala

"pause-when-idle" seems to be handled in gnome-plugin, and in gnome-plugin.vala you see this line:

this.can_enable = GLib.Environment.get_variable (CURRENT_DESKTOP_VARIABLE) == "GNOME";

So it seems gnome-pomodoro is designed to disable this feature altogether if the environment is not gnome.

kantord commented 6 years ago

@flanaras do you have a request or suggestion as per how this issue should be resolved?

flanaras commented 6 years ago

@kantord There could be an event listener, listening for keyboard or mouse events. When a pomodoro break is done, start the next one on the next input recorded.

flanaras commented 4 years ago

Wouldn't this defeat the purpose of the pomodoro technique?

jakob1379 commented 4 years ago

Wouldn't this defeat the purpose of the pomodoro technique?

Sorry - I misunderstood what you first meant. But see my proposed solution in the pull request, which does exactly what you proposed ^_^

uncle-betty commented 4 years ago

Oh, cool, you guys solved this problem already...

I also looked into this a while back and came up with a slightly different solution for myself: a Python daemon that emulates the functionality of the org.gnome.Mutter.IdleMonitor interface provided by the Mutter window manager, which gnome-pomodoro uses (at least on Ubuntu 18.04).

FWIW - https://gist.github.com/uncle-betty/dc0a1a0ecc51b2b1661e6e1ebc5bf7ae

My approach seems a little over-engineered, now that I see your solution. :) Also, I didn't know about X11IdleMonitor and thus poll by invoking /usr/bin/xprintidle.

jakob1379 commented 4 years ago

Well I have to make a little revision and make a new pr as I did some mistakes and kantor came with some better namings :rofl:

jakob1379 commented 4 years ago

Have anyone tried compiling i3-gnome with the source modded to just a static true and see if it works?