ivoronin / TomatoBar

🍅 World's neatest Pomodoro timer for macOS menu bar
MIT License
2.29k stars 107 forks source link

Implement Do Not Disturb switching via a shortcut #82

Open AuroraWright opened 2 months ago

AuroraWright commented 2 months ago

This implements https://github.com/ivoronin/TomatoBar/issues/30 . The shortcut is taken from https://github.com/arodik/macos-focus-mode which is under MIT as well, as far as I can tell. I also included the auto-resize commit from https://github.com/ivoronin/TomatoBar/pull/65 to make the popover UI work fine. If DND toggling is enabled, the user is prompted by Shortcuts.app to install the shortcut the first time the timer is run, and it works normally afterwards. DND.swift is basically taken almost verbatim from the Apple WWDC 21 Shortcuts examples, I've never worked with Swift before so feel free to double check.