Simple script to handle OSX Focus getting/setting and running logic on outside focus change.
- Uses Shortcuts - OSX only, but focus is synced to iOS/watchOS by default.
- Uses crontab for periodic launch, which means that there's a 1 minute delay before logic runs on exgernal focus change (e.g., on schedule).
- defaultbrowser - changes default browser (OSX asks you to confirm each time)
- Homebrew - optional, helps with install
- Actions - optional, useful Shortcuts actions
- Install defaultbrowser with
brew install defaultbrowser
- Import all Shortcuts
- Setup your focus values and logic in Shortcuts
- Place (symlink) the
focus
script into you $PATH e.g., .local/bin - This is optional only ever needed to run
focus
- script sets full path in crontab regardless - Make sure it's executable -
chmod a+x focus
- Edit the script to add your logic, e.g.,
killall Safari; open Google-Chrome
(might change this shortcut instead or in addition to) - Run
focus
once to create a crontab entryโ ๏ธ AddsSHELL=($SHELL)
to crontab unless it is set already