SHARE
TWEET

Sleep Display on Mac

a guest Feb 21st, 2013 735 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <CoreFoundation/CoreFoundation.h>
  2. #include <IOKit/IOKitLib.h>
  3.  
  4. int main(void)
  5. {
  6.         io_registry_entry_t r = IORegistryEntryFromPath(kIOMasterPortDefault, "IOService:/IOResources/IODisplayWrangler");
  7.         if(!r) return 1;
  8.         int err = IORegistryEntrySetCFProperty(r, CFSTR("IORequestIdle"), kCFBooleanTrue);
  9.         IOObjectRelease(r);
  10.         return err;
  11. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top