Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/snosrap/xpc_set_event_stream_handler
- Owner: snosrap
- License: mit
- Created: 2018-02-20T23:20:54.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-08-08T23:09:09.000Z (over 4 years ago)
- Last Synced: 2024-06-25T23:34:15.437Z (5 months ago)
- Language: Objective-C
- Homepage:
- Size: 7.81 KB
- Stars: 42
- Watchers: 6
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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