-
-
Notifications
You must be signed in to change notification settings - Fork 89
Open
Description
Dynamic Actions
It would be great if Leader Key could support dynamically generated groups that execute scripts to populate their contents at runtime.
Why?
Dynamic actions would allow Leader Key to integrate with any application/system that has an API and respond to that system.
I have made a proof of concept (vibe coded) for myself locally and have used this to dynamically control aerospace. leader-key + s shows active aerospace sessions, with the first letter of the space name as the next key to switch to it.
The menu would automatically be update when sessions are killed or created the next time the menu is shown.
Usage
{
"type": "group",
"actions": [
{
"key": "d",
"type": "dynamic",
"label": "Dynamic Items",
"value": "/path/to/your/script.sh"
}
]
}Script Requirements
A script must output a JSON array of actions/groups to stdout:
[
{ "key": "a", "type": "application", "value": "/Applications/Safari.app" },
{ "key": "b", "type": "url", "value": "https://example.com" }
]Considerations
- While the script is executing a loading spinner is displayed in the Leader Key window.
- Normally the cheatsheet is hidden, for dynamic items, it would be useful to show as soon as the script completes.
- Normally key strokes are executed immediately, for dynamic groups they would need to be queued and executed as the script(s) complete.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels