-
Notifications
You must be signed in to change notification settings - Fork 26
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
RFC: Command Hooks #10
Comments
Would be nice to include some context when calling the hooks. Having the description, tags, duration, etc. would likely be useful for scripts in a variety of ways. Setting them in |
I'm going to work on this soon, but instead of the description above I'm going to structure it like Git hooks:
These can be anything executable. I don't know if the hooks should 1-1 match subcommands, or if they should be logical events such as described above. They will be passed some or all information about a pomodoro, still figuring out how to structure that data. |
This would be nice to add a notification sound/popup when the pomodoro finishes. |
@facundoq I'd love that too, but it would require another service to be running and look for pomodoro status changes. I'd like to write a macOS menubar app soon (hopefully in Go?). |
One idea for making the finish actually get called when a pomodoro finishes is using the |
@jmburges Interesting! Is there a way to edit/remove those commands if needed, such as if the user cancels a Pomodoro or finishes early? I was thinking of relying on a separate process or GUI app (macOS menubar) that would implement the same interface /specification, and it could run hooks/play sounds/etc when the state changes. But then I suppose that's also an issue if you have multiple apps running, which one fires the hook? I'll read more about |
Yeah I think both Mac and Linux have the command or can install very easily. I’m playing around with a quick mock-up. |
hook for
|
Hi. I started using the tool today and I really like it. An idea to make this workflow work, at least for some people, is to add a new |
It would be nice to be able to associate any functionality you wanted when a pomodoro was started/completed, and we could accomplish that through hooks which execute shell commands.
Commands
There are a few commands where this makes sense:
start
- Start a new Pomodororepeat
- Repeat the last Pomodorofinish
- Finish the current Pomodorocancel
- Cancel the current Pomodorobreak
- Take a breakstart
Start is fairly straightforward, as it would exec the given command when the start command is passed.
repeat
Repeat would function the same way as start (it also delegates to start internally).
finish
Finish is a command which modifies the duration of the pomodoro to be
now - start_time
, effectively changing the end time to now. Typically I use it to finish a pomodoro early or late. Most of the time I never use this command, and instead just see that the pomodoro has ended and go take a break.Adding a hook to finish would either require either A) the user to use the finish command or B) a daemon which watches for pomodoros finishing and then runs commands.
I would not like to do B, because on top of adding a lot more complexity to run the manage the background process, there could also be running in a different environment, which would make some exec commands fail unexpectedly. But I'm not opposed to it.
cancel
Cancel effectively undos the last pomodoro. I think this should run the same hook as
finish
.break
I think it makes sense to merge
finish
andbreak
together, since they are both things you do at the end of the pomodoro. At the very least, finish should have a--break
flag which defaults to true or 5m (#7).Hooks
We could introduce 2 hook settings, representing a start or finish/end:
Multiple hooks
It should be possible to declare multiple hooks for the same event:
The text was updated successfully, but these errors were encountered: