Modes: open apps, arrange windows and quiet distractions in one click - #13
Merged
Merged
Conversation
- A mode lists apps to open and remembers where their windows go: arrange
them once and press "Use current window layout". Starting the mode opens
missing apps, waits for their windows and puts them back through the
Accessibility API, skipping placements on displays that aren't connected.
- Distracting apps can be left alone, hidden or quit while the mode is on.
- Optional sound (any scene, suggestion, mix or single sound) and focus
session.
- Ending a mode always stops sounds and the focus timer, shows the apps it
hid, and leaves open, minimizes or quits its apps. Switching modes keeps
apps both use. Brisa and the Finder are never touched.
- Start and end from the Modes tab, the menu bar, routines ("Start a mode",
"End the current mode") and, in signed builds, Shortcuts and Siri.
- Routines and Modes share one sound picker and one "play a sound choice".
- 11 tests for which apps are hidden, quit or kept, coordinate conversion,
off-screen placements and saving.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A new Modes tab. A mode (e.g. "Studying") has:
Starting a mode opens any apps that aren't running, waits for their windows and moves them into place. The first app ends up in front. A saved placement is skipped if it would land on a display that isn't connected. Switching from one mode to another keeps the apps both modes use. Brisa and the Finder are never hidden, quit or minimized.
Where to start and end modes
Permissions: moving, reading and minimizing windows uses the Accessibility API, the same permission the interaction sounds already ask for. Without it, modes still open, hide and quit apps; minimize falls back to hiding the app. Full-screen windows and other Spaces can't be moved by apps.
How it was tested
./Scripts/test.sh: 57 passed, 11 of them new. They cover which distracting apps are handled, which apps are put away when a mode ends or switches, never touching Brisa or the Finder, conversion from screen coordinates to Accessibility coordinates, rejecting off-screen placements, saving modes, and the new routine actions../Scripts/build.shsucceeds.