iloveitaly / hyper-focus

Block hosts, apps, specific urls (with query string vars!), launch scripts on wake, and generally optimize your productivity and focus
MIT License
50 stars 2 forks source link

Feature request: execute script when activating schedule #2

Closed ofalvai closed 1 year ago

ofalvai commented 1 year ago

First of all, thank you @iloveitaly for this little tool and its Raycast extension, this is exactly what I was looking for.

After setting up my custom config, I miss one final thing: the ability to run some "cleanup" commands when activating a schedule and maybe run another set of "restore" commands when deactivating the schedule. My actual use case for this would be to kill Slack and a few other distracting apps so they are completely removed from the dock.

Do you think this would fit the scope of this tool?

iloveitaly commented 1 year ago

@ofalvai I like this! I don't have a use for it, but if you want to submit a PR for it, I'd be happy to include it.

iloveitaly commented 1 year ago

@ofalvai I recently cleaned up the code around this: https://github.com/iloveitaly/hyper-focus/blob/0a44744c93621571f83eddcbdb45fcb34ac3f5e7/Sources/hyper-focus/sleepwatcher.swift#L52

In case you had time to submit a PR!

iloveitaly commented 1 year ago

This has been implemented! Check out the new JSON schema