Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

reddevil0728

macrumors 6502
Original poster
Jun 19, 2010
252
33
Tried InsomniaX 1.35. Somehow it doesn't work for the Early 2011 version of the MBP.

Any other alternatives?
 

It's a must to do all the steps if I want to have it activated on startup is it? If I do not want to have it activated on startup, I can simply just go System Preferences and activate it myself?

Is there a shortcut to the activation?

I only want to activate it so that it wouldn't sleep when I close the lid.

In addition, how do I write a script with the command to automatically launch the program on startup?
 
It's a must to do all the steps if I want to have it activated on startup is it? If I do not want to have it activated on startup, I can simply just go System Preferences and activate it myself?
Yes, InsomniaT installs under the "Other" section of System Preferences. You can log in, go to System Preferences, and activate it manually. By default it is not activated at log in, only by running a script at log in can you activate it automatically.

I only want to activate it so that it wouldn't sleep when I close the lid.
That's all InsmoniaT does. If it is active then your laptop won't sleep when the lid closes, if it is not active then the laptop does the default behavior (which is currently to sleep on lid close). Even if InsomniaT is active you can still manually sleep using the apple menu or keyboard shortcut (command+option+eject).

In addition, how do I write a script with the command to automatically launch the program on startup?
It's step 3 of that post I mentioned. Use TextEdit to create a new file with line "insomniat --disable", save the file as "insomniat_start.command", go to System Preferences->Accounts->(your account)->Login Items->(point to the location of your .command script). Reboot and you're good to go.
 
It's step 3 of that post I mentioned. Use TextEdit to create a new file with line "insomniat --disable", save the file as "insomniat_start.command", go to System Preferences->Accounts->(your account)->Login Items->(point to the location of your .command script). Reboot and you're good to go.
where is a good place to save the file?

If let's say it automatically runs on login, can I still inactivate it by going to system preferences?
 
where is a good place to save the file?
I keep mine in a "scripts" folder I made in Documents (although it is the only script there at the moment). It doesn't really matter where you keep it, just place it where you won't accidentally delete it (like don't keep it in Downloads).

If let's say it automatically runs on login, can I still inactivate it by going to system preferences?
Yes
 
I keep mine in a "scripts" folder I made in Documents (although it is the only script there at the moment). It doesn't really matter where you keep it, just place it where you won't accidentally delete it (like don't keep it in Downloads).


Yes

When I try to save the thingy this error came up.

d4e49cf7.jpg
 
oops. i didn't...

ok here's another problem

f9d72a6a.jpg

Based on the error message, you need to right-click on the file and click Get Info (or select the file and go File > Get Info).

At the bottom of the Info window, there should be a Sharing and Permissions category. Make sure that you can Read & Write (there should be several entries...pick the one that your account falls under, whether it's everyone or admin or whatnot).

Anyway, thanks for the find! Even SleepLess doesn't work on the newer MBP (for me at least).
 
Based on the error message, you need to right-click on the file and click Get Info (or select the file and go File > Get Info).

At the bottom of the Info window, there should be a Sharing and Permissions category. Make sure that you can Read & Write (there should be several entries...pick the one that your account falls under, whether it's everyone or admin or whatnot).

Anyway, thanks for the find! Even SleepLess doesn't work on the newer MBP (for me at least).
set all to read&write still same problem

What program is it supposed to be opened with? Terminal?
 
set all to read&write still same problem

What program is it supposed to be opened with? Terminal?
Read and write isn't important here. You need to set execute permission for the script. Open a terminal to the script file and run "chmod +x insomniat_start.command". Actually you may have to run "sudo chmod +x insomniat_start.command" instead, depends on your access permissions (if it doesn't work without sudo then try with sudo).

It is supposed to be opened with terminal.
 
Read and write isn't important here. You need to set execute permission for the script. Open a terminal to the script file and run "chmod +x insomniat_start.command". Actually you may have to run "sudo chmod +x insomniat_start.command" instead, depends on your access permissions (if it doesn't work without sudo then try with sudo).

It is supposed to be opened with terminal.

Don't quite get you but this is what I did. I click on the script, the error appear. After I click on a terminal appear. I key in the sudo.... then they prompt for password (which I assumed is the password which i need to input whenever i need to authorise certain stuff to be done) and somehow it's invisible but i just keyed it in anyway and hit enter. and this is what i see

eecd727c.jpg
 
That error occurred because the Terminal is not in the same working directory as your script. If your script is located at "/Users/john/Documents/scripts/insomniat_start.command", then open a terminal and run:

cd /Users/john/Documents/scripts
chmod +x insomniat_start.command

Or you can combine that into one command:
chmod +x /Users/john/Documents/scripts/insomniat_start.command

Again I don't remember if you need to use sudo or not for chmod, I doubt you do but if it doesn't work then try it with sudo.
 
That error occurred because the Terminal is not in the same working directory as your script. If your script is located at "/Users/john/Documents/scripts/insomniat_start.command", then open a terminal and run:

cd /Users/john/Documents/scripts
chmod +x insomniat_start.command

Or you can combine that into one command:
chmod +x /Users/john/Documents/scripts/insomniat_start.command

Again I don't remember if you need to use sudo or not for chmod, I doubt you do but if it doesn't work then try it with sudo.

Oh it works. But is it possible to prevent this terminal window from popping up by itself whenever the computer starts saying that the process completed?
 
Oh it works. But is it possible to prevent this terminal window from popping up by itself whenever the computer starts saying that the process completed?
Hmm, not sure. When I log in I see the terminal window appear and disappear in an instant. I don't get a popup or have the terminal stay open saying the process was completed. I think it leaves Terminal loaded in memory but it barely uses any space, I can manually terminate it if I want to (I don't care since I use Terminal a lot).

-Edit-
Maybe modify insomniat_start.command to look like this:

#!/bin/sh
insomniat --disable
exit

I tried a lot of things before getting insomniat to enable at launch, I don't remember if ^ works or not.
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.