-
-
Notifications
You must be signed in to change notification settings - Fork 262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pomodoro module is not updating timer when i3bar is not visible #179
Comments
Hello @pedro-nonfree, Well this behaviour is expected when running with mode hide only imho (I can't reproduce when doing full screen or switching to tty). This is not related to py3status but is instead a feature of i3bar.
This is here : http://code.stapelberg.de/git/i3/commit/?id=a83e7699e75cad515019aa1ad5f7d59ee236a918 The only workaround I could think of regarding pomodoro would be to calculate the remaining seconds based on a timestamp instead of a simple decrementation of an interger. But this couldn't beat the fact that you'd get no notification since the whole process is freezed by i3bar. Hope this helps mate. |
I'm using self compiled version: in Debian 8.3 Stable Jessie I don't know why you cannot reproduce it. Timestamp is a nice idea! |
@pedro-nonfree another workaround could be recompiling i3 with reverted a83e7699e7 commit. |
Problem with timestamp @pedro-nonfree is that you still would never get your pomodoro's notifications ! This defeats the whole point of it don't you think ? |
@Anon1234 Oh no, back to 2010 ? 😢 @ultrabug Use case is not always being in this "hide" situations. So you receive a late notification, better than nothing. Thinking in a better design, what about starting an independent background process for the timer and notification, and share that info with py3status to print it in the bar? This is in general useful for other modules such as battery notifications, perhaps for new possible modules? |
@ultrabug We definitely need to fix the pomodoro countdown to look at time.time() changes rather than naively assuming 1 sec/update. Alternatively, this could be addressed now by using subprocess to communicate with a pomodoro process. I've used subprocess to watch the output of |
@pedro-nonfree You wouldn't be going back to 2010, @Anon1234 is suggesting that you only revert that one commit. So you'd just run something like |
@pydsigner |
This patch works for me: diff --git a/i3bar/src/child.c b/i3bar/src/child.c
index 3570dde..3c787ee 100644
--- a/i3bar/src/child.c
+++ b/i3bar/src/child.c
@@ -654,10 +654,10 @@ void kill_child(void) {
*
*/
void stop_child(void) {
- if (child.stop_signal > 0 && !child.stopped) {
- child.stopped = true;
- killpg(child.pid, child.stop_signal);
- }
+ // if (child.stop_signal > 0 && !child.stopped) {
+ // child.stopped = true;
+ // killpg(child.pid, child.stop_signal);
+ // }
}
/* Tested with this module: from time import time, sleep
class Py3status(object):
cache_timeout = 1
count = 0
def incr_count(self, *args):
self.count += 1
return dict(full_text=str(self.count),
cached_until=time()+self.cache_timeout)
if __name__ == '__main__':
x = Py3status()
for i in range(5):
print(x.incr_count())
sleep(x.cache_timeout) |
@Anon1234 Now my question for i3, I understand this is a sweety optimization, but is necessary, really? |
@pedro-nonfree you don't need to revert if using the patch |
@Anon1234 true, latest master with that patch works. Correcting myself about that optimization: well, that commit fixed a bug... And I found a related issue to mode hide: after first pomodoro (during break, or next pomodoros) i3bar cannot hide. Pressing mod key, i3bard hides and appears again perhaps during print/sleep 1. |
Hello, This behaviour has been fixed thanks to the work of @tobes and @cornerman on PR #266 ! |
Hi,
Pomodoro's module timer is stopped when i3bar is not shown in display, situations where I found this:
I don't know if this could affect other modules that require to be updated.
For me this is a big issue that I don't know how to fix.
The text was updated successfully, but these errors were encountered: