MagicDesktop is a macOS menu bar app for saving and restoring full working layouts.
It can:
- launch apps that are not already running
- restore Finder and normal app windows onto specific monitors
- arrange layouts across multiple macOS Desktops
- apply windows in a saved front-to-back order
- trigger a configuration from the menu bar or a global shortcut
- rebuild and reinstall itself from a local clone
The app is an LSUIElement utility, so it lives in the menu bar and does not show a Dock icon.
Each configuration is an ordered layout made of:
- one or more saved macOS Desktops
- one or more displays inside each desktop
- one saved window layout per app bundle
- an optional global shortcut slot
That means a configuration is not just "open these apps". It is "restore this desktop sequence, on these monitors, with this window order".
When you run a configuration, MagicDesktop:
- checks Accessibility permission
- validates the current macOS Desktop environment
- matches the configuration to the current Mission Control desktop stack
- switches through the saved desktops in order
- launches or reuses each target app
- creates a Finder browser window when Finder needs one
- moves the chosen window onto the target desktop
- resizes and repositions the window on the target display
- raises windows in saved order so later items end up on top
Saved frames are display-relative whenever a display is known, so layouts survive monitor rearrangement better than absolute screen coordinates.
The settings window is a split view with two main areas.
Configurations: every saved layoutNew Configuration: creates another layout entryBuild & Install: rebuilds and reinstalls the app from a local repo cloneDiagnostics: captures a troubleshooting report with logs and local state
The Diagnostics… entry in the menu bar opens this pane directly so a bug report can be generated without navigating into the editor.
The editor is intentionally arranged from broadest scope to narrowest scope:
- Header bar
What you edit here:
configuration name, shortcut,
Capture Windows, andRun - Desktop bar What you edit here: desktop order, desktop selection, add desktop, rename desktop
- Workspace What you edit here: display overview, per-display canvas, app stacking order, capture for a single display
Choose a configuration from the sidebar or create a new one.
Use the desktop chips above the workspace to model the Mission Control desktops you want the config to restore.
- Desktop order matters
- desktop names are saved and applied back to macOS where possible
- the selected desktop controls what the workspace is editing
The Display Overview shows the currently connected monitors in their relative arrangement.
- click a monitor to edit that display
- the overview is horizontally scrollable for large monitor layouts
- app counts on each monitor card show how many saved windows belong to that display on the selected desktop
For the selected display, MagicDesktop shows:
- a canvas with draggable, resizable saved windows
- an app list on the right
- a front-to-back stacking order
You can:
- drag a saved window by its title bar
- resize it from the lower-right corner
- add an app to the selected display
- remove an app from the selected display
- reorder the app list to control which windows end up above others
The app list is not cosmetic. It controls the final raise order during restore.
Capture Windows captures the currently visible restorable app windows from the active macOS desktop into the selected saved desktop.
Capture Current Display only refreshes the selected display on the selected saved desktop.
Capture is space-aware:
- MagicDesktop only captures windows that belong to the active macOS desktop
- it does not intentionally pull a different window for the same app from another desktop
- accessory and status-item panels are excluded because they are not reliably restorable through the normal activation flow
Each configuration can be assigned one global shortcut slot.
- slot
1maps toCtrl+Option+1 - slot
2maps toCtrl+Option+2 - and so on through slot
9
You can run a configuration in two ways:
- from the menu bar menu
- from its global shortcut
The Run button in the editor triggers the same activation flow immediately.
MagicDesktop now treats multiple Mission Control desktops as a first-class part of a configuration.
Important rules:
- desktops are restored sequentially in the order saved in the editor
- the machine must already have at least that many user desktops created in Mission Control
- MagicDesktop currently supports the shared global desktop stack only
Displays have separate Spacesmust be turned off in macOS settings
If the environment does not match those rules, MagicDesktop stops and shows an explicit error instead of partially restoring the configuration.
Finder is handled specially because it often has no normal browser window until one is opened.
During restore, MagicDesktop will:
- detect when Finder is the target app
- open a real Finder browser window if needed
- wait for Accessibility to expose that window
- move and resize it like any other restorable window
This lets Finder participate in normal capture and restore flows instead of behaving like the desktop background.
The Build & Install screen is a developer convenience pane inside the app.
It shows:
- the selected local clone path
- the running app version
- the repo version from
project.yml - the installed app version in
/Applications
Build Latest & Re-install does the same workflow the project expects in development:
- optionally regenerate the Xcode project with
xcodegen generate - build the app with
xcodebuild - stabilize the built app's code signature
- replace
/Applications/MagicDesktop.app - relaunch the installed build
This keeps the running app aligned with the code in your repo instead of leaving an old build in /Applications.
- macOS 14+
- Xcode 16+
- XcodeGen
- Accessibility permission in
System Settings > Privacy & Security > Accessibility
xcodegen generate
xcodebuild -project MagicDesktop.xcodeproj -scheme MagicDesktop -configuration Debug build
open MagicDesktop.xcodeprojFor normal local development, install the built app to /Applications/MagicDesktop.app and relaunch it so the running version matches the repo version.
Configurations are stored at:
~/Library/Application Support/MagicDesktop/configurations.json
The model now persists desktops explicitly, and older single-desktop configurations are migrated automatically into a one-desktop shape when loaded.
- one saved app layout currently maps to one target window per bundle identifier
- the same app should not be intentionally assigned to multiple saved desktops in one configuration
- MagicDesktop does not create missing Mission Control desktops yet; create them first
- accessory popovers and menu bar panels are not captured as restorable layouts
- window restore still depends on what each target app exposes through macOS Accessibility APIs
If you are working in the codebase, these files are the main entry points:
Sources/Services/SpaceManager.swiftdesktop-aware activation flow, launch orchestration, Finder restore behaviorSources/Services/DesktopManager.swiftMission Control desktop enumeration, switching, naming, and window-to-desktop movesSources/Services/WindowManager.swiftAccessibility window discovery, frame capture, frame restore, and display-relative conversionSources/UI/ConfigurationEditorView.swiftmulti-desktop configuration editor and capture UISources/UI/SettingsView.swiftsplit-view settings window and sidebar routingSources/Services/BuildInstallService.swiftlocal build, reinstall, and version reportingSources/Models/SpaceConfiguration.swiftpersisted configuration model, including desktop-level layout storage
MagicDesktop is for setups that are more structured than "reopen the last few apps".
If your work depends on repeating the same desktop sequence, monitor placement, Finder window, and front-to-back stack every day, this app turns that setup into something you can restore on demand.
