Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/snosrap/xpc_set_event_stream_handler

Consume a com.apple.iokit.matching event, then run the executable specified in the first parameter.
https://github.com/snosrap/xpc_set_event_stream_handler

Last synced: 3 months ago
JSON representation

Consume a com.apple.iokit.matching event, then run the executable specified in the first parameter.

Awesome Lists containing this project

README

        

# xpc_set_event_stream_handler

Consume a `com.apple.iokit.matching` event, then run the executable specified in the first parameter.

This is useful when creating `launchd` LaunchAgents that are triggered by IO events (e.g., run a script when keyboard/mouse attached). Failing to consume the `com.apple.iokit.matching` event will result in the executable being called [repeatedly](https://stackoverflow.com/questions/13987671/launchd-plist-runs-every-10-seconds-instead-of-just-once).

This isn't really documented anywhere other than the `man` page for `xpc_set_event_stream_handler`.

## Example Property List





Label
com.example.KeyboardAttach
ProgramArguments

/usr/local/bin/xpc_set_event_stream_handler
/usr/local/bin/KeyboardAttachScript.sh

LaunchEvents

com.apple.iokit.matching

com.example.KeyboardAttach.Event

idVendor
1234
idProduct
56789
IOProviderClass
IOUSBDevice
IOMatchLaunchStream