-
Notifications
You must be signed in to change notification settings - Fork 71
Keep the machine from sleeping. #59
Comments
hmmm... I would think adding a line in the code like |
We could probably use this https://developer.apple.com/library/content/releasenotes/Darwin/RN-IOKitPowerManagment/ But I would be surprised it would work in a sandboxed app! |
this is (I believe) the current way: https://developer.apple.com/library/content/qa/qa1340/_index.html |
I ended up using: caffeinate -d -i -m -u & then killing the process, this has worked well for me. Thanks for all the comments :) |
You could also let
will maintain the assertions until the |
Hi All
|
( |
Would be great to add this code in new version 👍 |
Got some working on while testing var assertionID: IOPMAssertionID = 0
var success: IOReturn?
func disableScreenSleep(reason: String = "Unknown reason") -> Bool? {
//guard success != nil else { return nil }
success = IOPMAssertionCreateWithName( kIOPMAssertionTypeNoDisplaySleep as CFString,
IOPMAssertionLevel(kIOPMAssertionLevelOn),
reason as CFString,
&assertionID )
return success == kIOReturnSuccess
}
func enableScreenSleep() -> Bool {
if success != nil {
success = IOPMAssertionRelease(0)
success = nil
return true
}
return false
} |
Changing /usr/bin/open -a "$app" to /usr/bin/caffeinate -dimsu "/Library/Application Support/SplashBuddy/SplashBuddy.app/Contents/MacOS/SplashBuddy" worked for me |
I am hoping there is an option to keep the machine from going to sleep while splash buddy is active.
The text was updated successfully, but these errors were encountered: