Jump to content

Autosleep-Script


KWS
 Share

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

  • Like 1
Link to comment
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

Link to comment
Share on other sites

  • 4 weeks later...
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.

 

:)

Link to comment
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

Link to comment
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

Link to comment
Share on other sites

  • 1 month later...
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

Link to comment
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

Link to comment
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?

Link to comment
Share on other sites

  • 4 weeks later...
  • 2 weeks later...
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 ...

Link to comment
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

Link to comment
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:

Link to comment
Share on other sites

 Share

×
×
  • Create New...