Jump to content
Welcome to InsanelyMac Forum

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

  • Announcements

    • Allan

      Forum Rules   04/13/2018

      Hello folks! As some things are being fixed, we'll keep you updated. Per hour the Forum Rules don't have a dedicated "Tab", so here is the place that we have our Rules back. New Users Lounge > [READ] - InsanelyMac Forum Rules - The InsanelyMac Staff Team. 
KWS

Autosleep-Script

165 posts in this topic

Recommended Posts

This is only useful if sleep by menu command works flawlessly ...

 

KWSleep for 10.9.x (10.10-11 not tested ...)

KWSleepLion.zip

Basically consisting of 2 shellscripts: sleep.sh is running by launchd every 30 s (directory: /Library/Scripts/KWS/), los.sh monitors changes in com.apple.PowerManagement.plist (add changed sleeptime in syspref to sleep.sh). 
The installer includes a prog named EditKWSleep which is a "frontend" to change settings in the script. Obsolete for people with knowledge of shellscript syntax ...

Heres the manual of Edit KWSleep:

KWSleep Manual.pdf

Share this post


Link to post
Share on other sites

How do I install this please.

 

Manual sleep works fine, but not autosleep.

 

Tried double clicking the .app file, but no joy.

 

Thanks for any advice.

 

Roger

Share this post


Link to post
Share on other sites

I think you have to put the script in the startup Items folder. I used it for a while, now I don't need it anymore, but I remember thar I went to System Preferences, then Users and then I added the script to my startUp items....

 

Hope it helps

Share this post


Link to post
Share on other sites
This is a new version of PenntNeu-script, which now recognizes the setting "Never" for sleep-delay in energy-saver preferences. It works in 10.6 too. You must add It to Start Up Objects on your User Account ... :D

 

Added try ... end try to the script to prevent an error while running time machine backups ...

 

Great stuff.

 

I had forced sleep and wake but couldn'r get auto sleep to go to deep sleep.

 

Not quite the solution I was looking for but this script does it for me.

 

:)

Share this post


Link to post
Share on other sites
This is a new version of PenntNeu-script, which now recognizes the setting "Never" for sleep-delay in energy-saver preferences. It works in 10.6 too. You must add It to Start Up Objects on your User Account ... :thumbsup_anim:

 

Added try ... end try to the script to prevent an error while running time machine backups ...

 

Thnx, system goes to sleep, but the monitor stays on with black screen

will try other dvi poort

 

post back

 

T

 

OK, with dvi-b it works

Share this post


Link to post
Share on other sites
I think you have to put the script in the startup Items folder. I used it for a while, now I don't need it anymore, but I remember thar I went to System Preferences, then Users and then I added the script to my startUp items....

 

Hope it helps

 

hello Raton,

 

how did you fix this?

 

T.

 

edit; ok dvd drive was the problem, tsst issue

Share this post


Link to post
Share on other sites
hello Raton,

 

how did you fix this?

 

T.

 

edit; ok dvd drive was the problem, tsst issue

 

Hi,

I am interested to know how to fix the tsst issue on dvd drive.

What is tsst issue by the way?

TQ for your time.

Have a nice day

Share this post


Link to post
Share on other sites

hi,

 

i have sleep working, auto sleep working, waking up, but when my battery goes very low it just says that i have to plug it in or it will turn off and then it turns off. i would like it to auto sleep then! how?

 

 

 

thanks

Share this post


Link to post
Share on other sites
This is a new version of PenntNeu-script, which now recognizes the setting "Never" for sleep-delay in energy-saver preferences. It works in 10.6 too. You must add It to Start Up Objects on your User Account ...

Added try ... end try to the script to prevent an error while running time machine backups ...

To explain it in detail: this is no solution for any sleep-issue with the except of not working AUTOMATIC-Sleep. If your machine goes to sleep by menu-command and wake without problems, you can use it ...

To make this work, in main.scpt I had to change;

			if idleTime > systemSleepDelay then
			tell application "System Events"
				key code 58
			end tell
			tell application "System Events" to sleep
		end if

to;

			if idleTime > systemSleepDelay then
			do shell script "pmset sleepnow"
		end if

Share this post


Link to post
Share on other sites

If it works for you, its okay. I didnt know this sleepnow-command, so i used Applescript. After wake sleep started immediately again, so i added keycode 58 to reset the idletime ... :)

Share this post


Link to post
Share on other sites
If it works for you, its okay. I didnt know this sleepnow-command, so i used Applescript. After wake sleep started immediately again, so i added keycode 58 to reset the idletime ... :)
Much thanks for your script!

The symptom I had before the change was that the login windoid would pop up when the script triggered, and no sleep, perhaps there are timing issues with different hardware?

Share this post


Link to post
Share on other sites
Will the system sleep when I'm typing, using internet etc. or only after idle timeout?

It will sleep after the time since last user input (mouse movement, keyboard activity) ...

Share this post


Link to post
Share on other sites

Does it disable autosleep when watching video in QuickTime ar listening to music in iTunes? Or does it sleep in the middle of a movie? :)

Share this post


Link to post
Share on other sites
Does it disable autosleep when watching video in QuickTime ar listening to music in iTunes? Or does it sleep in the middle of a movie? ;)

Updated in first post ... :thumbsdown_anim:

Share this post


Link to post
Share on other sites
great work, Thanks.

Hope the future release can monitor disk activities like file coping, downloading etc.

I think this is not possible in Applescript, at least for me :(, so you must change the energy saver settings to 3 hrs or never during large downloads or file copying ...

Share this post


Link to post
Share on other sites
This is a new version of PenntNeu-script, which now recognizes the setting "Never" for sleep-delay in energy-saver preferences. It works in 10.6 too. You must add It to Start Up Objects on your User Account ... :)

 

Added try ... end try to the script to prevent an error while running time machine backups ...

 

To explain it in detail: this is no solution for any sleep-issue with the except of not working AUTOMATIC-Sleep. If your machine goes to sleep by menu-command and wake without problems, you can use it ...

 

Added three little changes to stop script while itunes, dvd-player or QuickTime is playing...

 

KWS,

RIP2.app was working great for Chameleon RC3 :) .

However with the latest Chameleon RC4 ( eliminate PlatformUUID.kext in E/E), auto sleep is no more working :( .

Would appreciate any inputs on getting RIP working again with Chameleon RC4 :P .

TQ & Have a nice day

Share this post


Link to post
Share on other sites
KWS,

RIP2.app was working great for Chameleon RC3 ;) .

However with the latest Chameleon RC4 ( eliminate PlatformUUID.kext in E/E), auto sleep is no more working -_- .

Would appreciate any inputs on getting RIP working again with Chameleon RC4 :P .

TQ & Have a nice day

Is sleep working by menu command ... I use pc efi 10.5, i replaced boot file with rc4 and sleep isn't working by menu command and so also not by RIP-script.

Funny is that i changed my dvd-drive some weeks ago and since that autosleep is perfectly working without my script. So i feel not too much motivated to change my working configuration for testing ... :rolleyes:

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Recently Browsing   0 members

    No registered users viewing this page.



×