Hear clicks
Pixling is preparing for Mac App Store release. Join the waitlist on pixling.app to hear when it launches.
Let your script react whenever the user clicks its resident. pixling resident events streams one JSON line per click while it runs. Pixling keeps no backlog, so clicks while nothing is listening are not delivered.
Try it by hand
Section titled “Try it by hand”Start streaming events from your resident:
pixling resident events --to client:my-agent/conversation-1Click the resident to watch lines arrive in Terminal, and press Ctrl+C to stop.
| Event line | When it prints |
|---|---|
{"event":"click"} |
Every plain click on the resident while listening. |
{"event":"ended","reason":"residentStowed"} |
When the resident is put away; the command then exits 0. |
React in a script
Section titled “React in a script”Pipe pixling resident events into a shell loop to run your own action on each click:
pixling resident events --to client:my-agent/conversation-1 --exclusive | while read -r line; do case "$line" in '{"event":"click"}') pixling message send --to client:my-agent/conversation-1 --text "You clicked me" ;; esac doneExclusive click handling
Section titled “Exclusive click handling”| Mode | Resident’s click reaction and shortcut | Hover reaction | Delivered to your script |
|---|---|---|---|
| Default (no flag) | Plays and opens as usual | Unchanged | Yes |
--exclusive |
Suppressed while your script listens | Unchanged | Yes |
- Only a plain click on the resident counts. Pixling does not watch other input, other residents, or other apps.
- The loop ends when the resident is put away or when you stop the pipeline.
- Stopping the pipeline with Ctrl+C restores normal click behavior right away.
Next steps
Section titled “Next steps”Follow a windowKeep a resident perched on another app's window with pixling resident follow.
Resident events referenceFlags, event payloads, and exit behavior for pixling resident events.