integralpro / nosleep

The MacOS X kernel extension, preventing sleep when you close the lid.
GNU General Public License v2.0
874 stars 45 forks source link

kext install location #7

Closed mag01 closed 5 years ago

mag01 commented 9 years ago

Please move the NoSleep.kext from /System/Library/Extensions/ (which is primarily dedicated for Apple's system extensions) to /Library/Extensions/ (where any 3rd party extensions should normally reside)

integralpro commented 5 years ago

Moved to the .app bundle from 1.5.0

mag01 commented 5 years ago

Moved to the .app bundle from 1.5.0

Great thing about kexts in /Library/Extensions/ (or /System/Library/Extensions/) is that they are loaded on startup. That means you don't need the NoSleep.app running in order to keep the NoSleep.kext loaded. With 1.5.0 I simply copied the NoSleep.kext to /Library/Extensions and then rebuild kext caches and after restart the kext was loaded even though the app wasn't running.

The only drawback is that if you launch the app sometime later and then exit it, the kext still gets unloaded (even though the "no sleep" options are enabled in the app).

If you're unloading the kext on the app exit, you shouldn't do it if the kext was already loaded when the app started, or if the "no sleep" options are enabled.