The action grid
- In the layout editor, add the Action Grid widget to a page. Until there are actions it says "No actions yet".
- Choose Edit Actions…, under Widgets in the menu. The first time, it writes
~/Library/Application Support/Wingmirror/actions.jsonwith four examples and opens it in whatever you edit JSON with, or TextEdit. Reveal Actions File shows it in Finder. - Edit and save. The panel picks the change up within a few seconds.
Each entry under actions is one button:
{
"actions": [
{ "id": "downloads", "label": "Downloads", "icon": "folder", "open": "~/Downloads" },
{ "id": "focus", "label": "Focus", "icon": "bolt", "shortcut": "Start Focus" },
{ "id": "deploy", "label": "Deploy", "icon": "rocket", "colour": "accent", "confirm": true,
"shell": "cd ~/Sites/shop && ./deploy.sh", "timeout": 900 }
]
}
| Key | Meaning |
|---|---|
id | Required. Lower-case letters, digits and hyphens, starting with a letter or digit, up to 40 characters, and no two the same |
label | Required. What the button says, up to 24 characters |
open, shortcut or shell | Exactly one. open is a web address or the path of a file, folder or app (~ is understood). shortcut is the name of a shortcut in the Shortcuts app. shell is a command line, run by /bin/zsh -lc in your home folder. |
icon | Optional: play, stop, terminal, folder, globe, rocket, refresh, lock, moon, sun, speaker, mute, camera, mail, calendar, branch, hammer, bug, check or bolt. deploy, git and build are also understood, as the rocket, the branch and the hammer. Without one, or with any other name, the button shows the label's first letter. |
colour | Optional: accent or plain. Plain unless given. |
confirm | Optional: true asks for a second tap before running. The button says "Tap again to run" and waits three seconds for it. |
timeout | Optional: seconds before a run is stopped, 1 to 3600. Ten minutes unless given. |
The rules of the file:
- Up to 48 actions, and the file no larger than 256 KB.
- Other keys at the top level are ignored, so the file can carry notes; the examples keep theirs under
about. A key inside an action that is not in the table is an error, so that a misspeltconfirmcannot quietly become a button that runs on one tap. - If anything in the file is wrong, nothing changes: the last good set stays and the grid says what the problem is, naming the entry and the rule.
- Sending key presses is not supported, since that would need the Accessibility permission.
What a button does when tapped: it shows "Running" while its action runs and whether it finished or failed, with the last line the command printed when it failed. An action that is already running is not started again, and one that outlasts its timeout is stopped. Commands run with a clean environment: your home folder, a PATH of /opt/homebrew/bin, /usr/local/bin and the system folders, and nothing of the app's own.
What the panel can and cannot do with it: the commands run as you, with your full rights, so they are read from this file and nowhere else. The panel is told each button's id, label, icon and colour, and sends back an id and nothing more. It never sees a command, and no widget or agent can add an action or change what one does.