set_app_rule
Assign an app to open future windows into a numbered zone on a selected monitor, preserving your layout across reboots and screen renumbering.
Instructions
Make an app's windows open into a numbered zone from now on, so an arrangement holds without anyone dragging: 'Slack always in zone 1 on the second monitor'. 'app' is matched anywhere in the app's name or bundle id, case-insensitively, the way get_state.excluded_apps entries are; a bundle id such as 'com.tinyspeck.slackmacgap' is the safest form. 'zone' is the number Plonk draws on the zone (1-based) in the set assigned to that monitor. 'screen' is a monitor index from get_state and is stored as that display's identity, so it survives a reboot renumbering the screens; omit it and the window stays on whichever screen it opened on. One rule per app: setting it again replaces the old one; a rule that names the app exactly wins over a bare-word rule. Applies to ordinary windows that open after it is set, not to windows already open (use snap_window for those) and not to dialogs or panels. An app on get_state.excluded_apps is left alone even with a rule. A rule beats the habit Plonk keeps of where an app's last window went, and both beat filling an empty zone. Current rules are get_state.app_rules. Fails when 'screen' names a monitor that is not attached or a zone that monitor's set does not have.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| app | Yes | App name or bundle id to match, e.g. 'com.apple.Safari' or 'Safari' | |
| zone | Yes | 1-based zone number, as shown on the drag overlay | |
| screen | No | Monitor index from get_state (0 = primary); omit for the screen the window opens on |