clapet
clapet copied to clipboard
Alternatives to `pmset`
There seemed to be kIOPMAssertionTypePreventSystemSleep
in IOKit.pwr_mgt
but it does not seem to work and the comment above the variable declaration in source code says "Deprecated in 10.9. This assertion is not supported in any OS X releases.".
The only solution I found is pmset
but it is not ideal since this utility requires root privileges to be ran. pmset
is currently necessary to :
- Disable and enable sleep
- Check if any app has made an assertion to prevent idle sleep
- Put the computer to sleep