Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

A kernel extension to disable 'sleep on close' System
Looks like someone finally wrote a no-sleep extension that really works. Insomnia (GPL) appears to be a rewrite of the old OS 9 Insomnia extension for OS X. Combined with a couple commands shown on their front page, it provides a quick and easy way to prevent your PowerBook from sleeping with the lid closed.

robg cautions: There is kbase article on Apple's site that explains how to use a PowerBook with the lid closed, so this is apparently an OK thing to do. With that said, I know how hot the left-side of my 12" PowerBook G4's palm rest gets during use, and I know I wouldn't want all that heat going directly towards the LCD. So I'm not likely to use this trick, but it should be safe, based on Apple's kbase article. It basically just lets you used the PowerBook while closed, without requiring the external connections. Still, use at your own risk...
    •    
  • Currently 3.00 / 5
  You rated: 5 / 5 (6 votes cast)
 
[45,437 views]  

A kernel extension to disable 'sleep on close' | 25 comments | Create New Account
Click here to return to the 'A kernel extension to disable 'sleep on close'' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
A kernel extension to disable 'sleep on close'
Authored by: luhmann on Mar 11, '05 10:34:10AM

While some powerbooks can be run with the lid closed, iBooks were not designed to do this and running an iBook with the lid closed poses serious risks!

Also, the free application <a href="http://www.macupdate.com/info.php/id/10564">Sleepless</a> has long had this functionality.



[ Reply to This | # ]
A kernel extension to disable 'sleep on close'
Authored by: luhmann on Mar 11, '05 10:34:34AM
While some powerbooks can be run with the lid closed, iBooks were not designed to do this and running an iBook with the lid closed poses serious risks! Also, the free application Sleepless has long had this functionality.

[ Reply to This | # ]
A kernel extension to disable 'sleep on close'
Authored by: leenoble_uk on Mar 11, '05 11:10:01AM

This is fantastic. I usually use dual displays on my powerbook, now I can switch back and forth from one to two displays without having to type in my password.

If I close the PB now the extra monitor stays on and I can do a Detect Displays from the menu extra and I'm back to a single monitor with no blackout.

BTW. I'm a longtime user of Sleepless, and it does not offer this functionality.

---
So, I said ... well, I can't actually remember exactly what I said. But it was one of the most enormously cruel and frighteningly witty put downs ever.



[ Reply to This | # ]
A kernel extension to disable 'sleep on close'
Authored by: leenoble_uk on Mar 11, '05 11:13:15AM

Oh, quick question. I followed the layout of /System/Library and installed this extension in /Library/Extensions

Will that mean it will load automatically upon reboot or do I always have to issue the kextload command. I ask because I had to create the Extensions directory and I don't know if this will work the way the other Library folders do?

---
So, I said ... well, I can't actually remember exactly what I said. But it was one of the most enormously cruel and frighteningly witty put downs ever.



[ Reply to This | # ]
A kernel extension to disable 'sleep on close'
Authored by: jolinwarren on Mar 11, '05 12:54:16PM

Yes, it will load automatically every time your Mac boots. The folders in /Library/ work exactly like their counterparts in /System/Library/. The only difference is that you can modifiy the contents of /Library/ but you're not supposed to mess with /System/Library/.



[ Reply to This | # ]
A kernel extension to disable 'sleep on close'
Authored by: Spartacus on Mar 11, '05 06:22:16PM

I am almost sure kernel extensions are an exception to this. They will be loaded only if they reside in the /System/ tree. I read something about it a while ago but am unable to find it back.



[ Reply to This | # ]
A kernel extension to disable 'sleep on close'
Authored by: jeremyp on Mar 13, '05 06:28:39AM

The kextd man page says only /System/Library/Extensions. The implication in the documentation is that it is OK to put device drivers there - having just checked my Mac, Keyspan seems to think it's OK anyway.

Note that putting a driver in /System/Library/Extensions does not guarantee that it will be loaded. The extension manager will only load it if it thinks it is needed for some device.



[ Reply to This | # ]
A kernel extension to disable 'sleep on close'
Authored by: abyone on Mar 14, '05 11:58:31AM
The system/Library/extension location is where you have to install kexts. It's kosher and documented by apple to work that way: "When your KEXT is installed, it will be installed into the Extensions folder, at /System/Library/Extensions under Mac OS X."

Why this one folder violates the System/ conventions, I'm not sure. Probably because the code is loaded into the kernal, so all kexts have to be owned by root (and not writable by anybody else), as a security precaution.

Could also be a performance issue, since there is a bootcache, to speed startup, maybe they didn't want the kext's in all of the hierarchies.

[ Reply to This | # ]

A kernel extension to disable 'sleep on close'
Authored by: huzzam on Mar 15, '05 02:56:05AM

Will that mean it will load automatically upon reboot or do I always have to issue the kextload command?

Couldn't you answer this question yourself by simply restarting your computer & seeing whether the computer sleeps on close afterwards?

peter



[ Reply to This | # ]
A kernel extension to disable 'sleep on close'
Authored by: ms_t_rie on Mar 11, '05 11:32:53AM

I'm not sure what this adds that's different from the built in functionality of the newer Powerbooks. I've been able to use mine with the lid closed from day one, without any additional software. I just plug the monitor into the sleeping powerbook and as soon as I plug in the USB keyboard, the Powerbook wakes up, detects the monitor and I'm ready to go. I suppose if the keyboard was bluetooth, then you might need something like that extension though.



[ Reply to This | # ]
A kernel extension to disable 'sleep on close'
Authored by: vocaro on Mar 11, '05 02:17:01PM
I know how hot the left-side of my 12" PowerBook G4's palm rest gets during use, and I know I wouldn't want all that heat going directly towards the LCD.
This is not a problem with my 1.33GHz PowerBook G4. At work, I hook it up to an external mouse, keyboard, and display and run it all day long with the lid closed. No heat issues at all, for nearly a year and counting.

[ Reply to This | # ]
A kernel extension to disable 'sleep on close'
Authored by: n8gray on Mar 11, '05 03:49:14PM

Me too. I run all day every day with the lid closed and it's never been a problem. I also do a lot of compiling and numerically intensive work on my laptop so you can rest assured that this is safe even under heavy CPU loads.



[ Reply to This | # ]
A kernel extension to disable 'sleep on close'
Authored by: jzdziarski on Mar 11, '05 02:40:16PM

A couple hints/tips:

1. Sleepless does /not/ offer this functionality. It is advertised, but never worked.

2. This extension allows you to run with the lid closed /without/ an external monitor or keyboard, which is nice if you just want to idle but protect the screen from dust, or if you're mobile around the office.

3. If you drop the following scripts in a ~/Library/Scripts/Insomnia folder, you can turn it on/off from the menu:

Turn Insomnia On:
#!/bin/bash

sudo kextunload /path/to/your/Library/Extensions/Insomnia.kext

Turn Insomnia Off:
#!/bin/bash

sudo kextload /path/to/your/Library/Extensions/Insomnia.kext

4. I've got one of the new (1.67 Ghz) powerbooks, and this functionality didn't come standard.. not sure who thought it did, but it doesn't.

I've been using it for the past couple days, and it works great.



[ Reply to This | # ]
A kernel extension to disable 'sleep on close'
Authored by: jzdziarski on Mar 11, '05 02:41:16PM

Sorry, got those script names backwards.



[ Reply to This | # ]
A kernel extension to disable 'sleep on close'
Authored by: hamarkus on Mar 11, '05 04:04:47PM

Sorry, could you elaborate on what you meant with "named backwards"? Or could you maybe repost them? Thanks.



[ Reply to This | # ]
A kernel extension to disable 'sleep on close'
Authored by: Aietes on Mar 11, '05 06:22:31PM

He just switched the scripts, so where the header says "Turn Insomnia on" the script to turn it off follows and vice versa



[ Reply to This | # ]
A practical solution for iBooks
Authored by: olsen on Mar 11, '05 06:40:20PM

In order to prevent iBooks from going to sleep, you can put a small coin (tested with 5 euro cent) about 2cm below the arrow keys (you will notice a magnetic attraction).

---
Mac Gamer



[ Reply to This | # ]
not recommended for iBooks
Authored by: hayne on Mar 13, '05 12:29:34PM

As others have already noted, it is a bad idea to run an iBook with the lid closed unless you enjoy the smell of melted plastic. The iBooks are not designed for this - unlike the PowerBooks.



[ Reply to This | # ]
A kernel extension to disable 'sleep on close'
Authored by: Anidel on Mar 11, '05 07:04:37PM

On the Insomnia's webpage it states:

[code]However the ApplePMU will shutdown your system after 4 minutes under 10.3.[/code]

Does it mean, to you too, that it does NOT work under 10.3?
What's the use of keeping it up for only 4 minutes?

---
Anidel



[ Reply to This | # ]
A kernel extension to disable 'sleep on close'
Authored by: ShaneVsEvil on Mar 11, '05 07:16:09PM

I believe that only occurs if the power adapter is not plugged in. I'm still trying this.



[ Reply to This | # ]
A kernel extension to disable 'sleep on close'
Authored by: corywright on Mar 12, '05 11:18:21AM

I just tried this tip with on my new 15" powerbook with my power adapter plugged in and 10.3 still went to after 4 minutes.



[ Reply to This | # ]
A kernel extension to disable 'sleep on close'
Authored by: paulsomm on Nov 15, '05 09:02:00PM

Seems to go to sleep after 4 minutes under 10.4.3 as well :(



[ Reply to This | # ]
12-inch runs cooler with lid closed
Authored by: nickp on Mar 11, '05 10:35:18PM
I was amazed too, but using Marcel Bresink's excellent Temperature Monitor I found that my 12-inch aluminum powerbook (Rev A) actually ran cooler (by about 1.5 deg C, as I recall) with the lid closed than with the lid open and the LCD turned off. Go figure.

I use a Podium Pad that elevates the rear end of the laptop, and things may be different if it is in contact with a surface. Also, I did this testing before downgrading my AppleADM103x.kext to the one from 10.2.8, as described in this hint and the reply by junkiesxl , which may affect the results.

Perhaps more understandably, it runs even cooler upside-down (in which case the lid must be closed, obviously). At some point, I may re-wire things and see how it runs when positioned vertically, like a book ...

[ Reply to This | # ]

12-inch runs cooler with lid closed
Authored by: Jeremy M. Dolan on Mar 12, '05 10:01:32PM

I recently purchased one of the new (G4, 1.5GHz) 12" Powerbooks to replace my senile (P2, 266MHz) Linux box as my main PC, for work, school, and everything in between. I planned to use it on my desk, with a "real" keyboard, mouse, and monitor, 90% of the time, so I was a bit taken aback when I found out running these things closed was considered unusual around the Apple community.

So just last week I did my own temperature benchmarks. I can second nickp's observations. (And I was quite surprised as well!) This is driving a 19" SVGA monitor at 1280x, so certainly the graphics card is working harder. I don't think LCDs generate much if any heat, so I doubt that's the cause of the cooldown. But then I noticed that with the screen open, airflow from the three major ventilation ports on the back of the laptop's base are somewhat obstructed. Undoubtedly Apple placed them there to keep the front and sides streamlined, but the screen pivots down right in front of them. Crazy.

Anyway, the point here is that the temperatures are fine. Even playing a little bztank, which heats the GPU to 154ºF (86ºC, for my metric friends) and more, it's usually a degree or two cooler with the screen closed. The only potential issue is screen damage from heat transferring up, of which I can report absolutely no problems. Besides, if the article in Apple's knowledge base says you can do it, and I have the three year AppleCare warrantee, what am I worried about? Worst case scenario, I get a shiny new Powerbook after mine melts into a puddle.

/jmd



[ Reply to This | # ]
A kernel extension to disable 'sleep on close'
Authored by: Gerk on Mar 23, '05 03:49:13PM

What about pmset ?? you can do this with pmset from what I read . . . man pmset ;)



[ Reply to This | # ]