4 ms·
Is there an equivalent of udev on Mac OS so I don't have to run a cronjob to check the battery percentage all the time? I know how to get the percentage from io
by dewey 11y ago
Is there an equivalent of udev on Mac OS so I don't have to run a cronjob to check the battery percentage all the time? I know how to get the percentage from ioreg but i'd be nice to be able to just listen for that api call like udev does.
- bluerobotcat 11y agoI/O Kit can be used for this. [1] [1] https://developer.apple.com/library/mac/documentation/DeviceDrivers/Conceptual/IOKitFundamentals/PowerMgmt/PowerMgmt.html#//apple_ref/doc/uid/TP0000020-SW4 https://developer.apple.com/library/mac/documentation/Device... (I'm a bit surprised that the docs assume that the reader is implementing a driver. I have used I/O Kit in an app that was available on the App Store.)