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

NoSleep Utility Does Not Start on System Startup (Preference Does Not Persist) #42

Open tree-frog opened 5 years ago

tree-frog commented 5 years ago

There is a logic error in the program that prevents NoSleep from starting on system startup when the directory "~/Library/LaunchAgents" does not exist. It appears that the NoSleep launch agent is not created if this folder does not exist (as is the case on a new installation of MacOS). This results in the preference not sticking.

This can be manually fixed by running the following command: mkdir ~/Library/LaunchAgents

I noticed this issue on a new installation of MacOS 10.14.3 (where NoSleep otherwise works flawlessly!), though I'm sure it exists on other versions of MacOS. NoSleep should be updated to create the user LaunchAgents folder if it does not exist rather than fail silently.

Thanks for the great work!

sdykae commented 5 years ago

Please Fix