Contribute
Register

Workaround for energy saver sleep and critical battery sleep.

Status
Not open for further replies.
Joined
Oct 18, 2011
Messages
190
Motherboard
ProBook 4530s
CPU
i3 2310M
Graphics
HD3k & Radeon 6450M
Mac
  1. 0
Classic Mac
  1. 0
Mobile Phone
  1. iOS
This app gets the settings from System Preferences so it does not need any more setup. Just enter System Prefs and select when You want Your laptop to sleep (works for battery and AC separately). Place the app wherever You like and put it into login items, the only output it gives to the user is in the console.

Thanks to that You can finally fall asleep in front of Your computer and You won't wake up with it drained (happend to me all the time) :)

More in github readme file. http://github.com/riodoro1/Bed-Time

Here is the app (updated), please report any bugs!

Merry Christmas! :)
 

Attachments

  • Bed Time11.zip
    30 KB · Views: 386
thanks! nice, but one thing: i think its to early with the hibernate at 10%
you should set it to 3% also you can implementate a function that, if you power it up, after it has hibernate it let you drain the battery full out..
i mean, i have 10% it hibernates.. but i turn it on again, and it forces to hibernate again, get it?

Thanks for your work though
 
Thanks! On GitHub page in readme file i've put a way to setup different hibernation battery level, it is 10% as some probooks (mine at least) won't go to sleep when battery is >10%. Nice idea with letting user drain the battery after manual wake up, check with the new version in the first post ;)
 
I'm using this workaround but it's been useless. I mean, it goes to sleep automatically but wakes up immediatly. How come?!
 
I'm using this workaround but it's been useless. I mean, it goes to sleep automatically but wakes up immediatly. How come?!

Try boot with darkwake=10
 
Thank you @riodoro1 . Latest commit on Dec 18, 2012, hmm.. Does this still work in High Sierra? Or is there a working alternative for 10.13.x?

[EDIT]: testing SmartSleep by jinx.de (Patrick Stein) now. Not sure though if it actually auto-powers down or auto-sleeps at x% battery level.. I'll see

[EDIT2]: syscl's IOPowerManagement is even tailored for hackintoshes: https://github.com/syscl/IOPowerManagement
I'll see if it still works on 10.13.6
 
Last edited:
Thank you @riodoro1 . Latest commit on Dec 18, 2012, hmm.. Does this still work in High Sierra? Or is there a working alternative for 10.13.x?

[EDIT]: testing SmartSleep by jinx.de (Patrick Stein) now. Not sure though if it actually auto-powers down or auto-sleeps at x% battery level.. I'll see

[EDIT2]: syscl's IOPowerManagement is even tailored for hackintoshes: https://github.com/syscl/IOPowerManagement
I'll see if it still works on 10.13.6
So what are you using and how is it working for you?
 
I've tested IOPowerManagement's IOPowerDeploy.kext and it didn't work at all.
I'm not sure using apps to solve this is a good idea, since they only work when proper user is logged in.
So I wrote a perl script and added it to cron (using lingon X) for every minute running
Code:
#!/usr/bin/perl
$output=`ioreg -w0 -l | grep Capacity`;
$output =~ /Capacity"=(\d+),"Current"=(\d+)/;
$percent = $2/$1*100;
if ($percent < 5) {
    system ('pmset sleepnow');
} else {
    #print "Battary is good\n";
}
I'm using SmartSleep to avoid storing hibernate image on sleep when battery level is above 20%
Those who don't want to purchase it, can use altered version of the script
Code:
#!/usr/bin/perl
$output=`ioreg -w0 -l | grep Capacity`;
$output =~ /Capacity"=(\d+),"Current"=(\d+)/;
$percent = $2/$1*100;
if ($percent < 5) {
    system ('pmset hibernatemode 3');
    system ('pmset sleepnow');
} else {
    #print "Battary is good\n";
    system ('pmset hibernatemode 0');
}
If your system doesn't support sleep at all (like Skylake/Kabylake on iGPU) you can just set pmset hibernatemode 25 manual and use first version of the script
 
I've been using a script I adapted - it's been working 100% sweet and reliable. I'm in the process of fine-tuning two last tidbits incl. two installer scripts, one for with sound alert and one for silent. I'll release in a dedicated thread in a bit once the ReadMe is complete and will post the link here. You'll like it :)
 
Last edited:
Status
Not open for further replies.
Back
Top