Skip to content

Add screen presets feature#1746

Closed
Diastro wants to merge 1 commit into
rxhanson:mainfrom
Diastro:screen-presets
Closed

Add screen presets feature#1746
Diastro wants to merge 1 commit into
rxhanson:mainfrom
Diastro:screen-presets

Conversation

@Diastro
Copy link
Copy Markdown

@Diastro Diastro commented Apr 19, 2026

Summary

Adds a new Settings tab for saving and restoring named window-layout presets, each with its own keyboard shortcut.

  • Capture: Create a preset with + to snapshot every visible window of every running regular app, or use Add App... to pick a single installed app and capture one window at a time via a searchable popover.
  • Restore: Each preset binds to a MASShortcut and also has a Restore Now button. Windows are placed proportionally using relative frames (0-1 fractions of the capture-time display), so the layout scales across different-sized displays. Apps that are installed but not running are launched first; uninstalled apps are pruned automatically.
  • Multi-display: The primary display is the system primary (screen at origin 0, 0), not NSScreen.main. Each captured window records a screenIndex so you can move it between primary and secondary displays via Edit App....
  • Storage: Presets persist to UserDefaults under screenPresets and are deliberately kept out of the main Config export/import.
image

Save named window-layout presets keyed by monitor count, restore them
with a dedicated keyboard shortcut per preset.

- New Presets tab in the Settings window shows a live monitor diagram,
  per-preset shortcut picker (MASShortcutView), and a table of captured
  app/window rows.
- Create a preset via the + button to snapshot every visible window of
  every running regular app; Add App opens a searchable popover that
  lists every installed app and captures a single window at a time.
- Capture uses CG on-screen list as ground truth (layer 0, alpha > 0,
  100x100 minimum) cross-referenced with AX standard windows.
- Restore moves windows proportionally using a relative frame stored as
  0-1 fractions of the capture-time display, so windows scale to the
  current display size. Apps that are installed but not running are
  launched first. Uninstalled apps are pruned automatically.
- Primary display is sourced from the system configuration (screen at
  origin 0,0), not NSScreen.main, so captures are not affected by the
  currently-focused window.
- Presets persist to UserDefaults under "screenPresets" and are kept
  out of the main Config export/import.
@Diastro Diastro marked this pull request as ready for review April 19, 2026 22:56
@rxhanson
Copy link
Copy Markdown
Owner

Thanks for contributing!

My preference at the moment is to have this new settings tab hidden by default, and shown either by setting a default via Terminal command or via a checkbox in the popover in the ellipsis button at the bottom of the General tab. One of my main goals with Rectangle has always been to keep it really simple and approachable out of the box, although I view it as a community-oriented project so I want to keep it flexible with nearly anything people want to add in.

I'll dive into testing and reviewing the code soon.

@Diastro Diastro closed this Apr 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants