Skip to content
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

Transform script into a daemon #10

Open
dominikmayer opened this issue May 30, 2011 · 7 comments
Open

Transform script into a daemon #10

dominikmayer opened this issue May 30, 2011 · 7 comments

Comments

@dominikmayer
Copy link
Contributor

Would provide a way to communicate with the running script:

  • Start
  • Stop
  • Restart
  • Start with different times
  • ...

Session file would no longer be required but I would still keep it because of its obvious features:

  • Pomodoro keeps running while script is down
  • Synchronization between several machines/people via Dropbox

Other way to implement both: Timestamp in a configuration file.

Daemon template: http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/

@dattanchu
Copy link
Owner

Start, stop, restart, start with different times can already be done with the current version by setting the correct timestamp. Synchronization between several machines via Dropbox is already possible by letting Dropbox handle the session file.

Also, in which situation would we want pomodoro to keep running while script is down?

@dominikmayer
Copy link
Contributor Author

Start/Stop

The only way to stop a pomodoro right now would be to delete the session file. I don't think it's a good idea to have a shortcut bound to "rm ~/.pymodoro/session_file".

Dropbox

I know. That's what I meant.

Pomodoros keep running while the script is down

I can close the script when the Pomodoro is down to 20 minutes, open it after five minutes and it will show fifteen remaining minutes. The time is not handled by the script itself. That's great.

Different times

I think the advantage of a daemon would be the possibiltiy to change its behaviour while it is running. Let's say I'm not doing Pomodoros (25 min.) for the moment but I'd like the script to count the time until my noodles (10 min.) are done. I could type something like "pymodoro.py 10" in any command line and it would switch the session duration of the running instance in the bar to ten minutes. Right now there is no way to do this without restarting Xmobar.

@dattanchu
Copy link
Owner

For stopping, you can set the session_file time to 25 minutes earlier. A simple way to accomplish this is to set the time with touch -r pomodoro.py session_file which should work most of the time (except within the first 25 minutes after which the user download the entire script).

For starting a different time, it is quite simple, simply add a command mode for pymodoro.py

pymodoro.py touch 10

This should set the session file so it has 10 minutes left. This method can also extend to handling Stopping a pomodoro session:

pymodoro.py touch -1

@dominikmayer
Copy link
Contributor Author

You're right. I hadn't thought about that. I'm still not completely convinced, though. The progress bar would not reflect the change.

@dominikmayer
Copy link
Contributor Author

I do agree that there are other ways than daemonizing (see also the suggestions in Issue #4) but don't you think a daemon would be comfortable?

@dattanchu
Copy link
Owner

I think daemonizing will eventually be realized. I don't feel that the complexity of the feature-set requires this yet.

@dominikmayer
Copy link
Contributor Author

I added support for setting times in the session file (closes Issue #4).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants