Jump to content

Autosleep-Script


  • Please log in to reply
164 replies to this topic

#1
KWS

KWS

    InsanelyMac Protégé

  • Donators
  • 79 posts

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

 

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

Attached File  KWSleepLion.zip   272.25KB   5 downloads

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:

Attached File  KWSleep Manual.pdf   172.48KB   2 downloads



#2
iorr

iorr

    InsanelyMac Protégé

  • Just Joined
  • Pip
  • 3 posts
Works, great job.
Thanks

#3
pet1

pet1

    InsanelyMac Sage

  • Members
  • PipPipPipPipPip
  • 269 posts
  • Gender:Male
  • Location:Classified
  • Interests:Trax and Hax
autosleep now works perfectly.. thank you.

#4
rogerabc

rogerabc

    InsanelyMac Protégé

  • Members
  • Pip
  • 7 posts
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

#5
The Raton

The Raton

    InsanelyMac Protégé

  • Members
  • Pip
  • 44 posts
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

#6
FKA

FKA

    are we there yet?

  • Members
  • PipPipPipPipPipPipPipPipPipPip
  • 1,626 posts
  • Gender:Male

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.

:)

#7
tinush

tinush

    InsanelyMac Sage

  • Members
  • PipPipPipPipPip
  • 262 posts
  • Location:Amsterdam

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

#8
tinush

tinush

    InsanelyMac Sage

  • Members
  • PipPipPipPipPip
  • 262 posts
  • Location:Amsterdam

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

#9
helob

helob

    InsanelyMac Geek

  • Members
  • PipPipPipPip
  • 218 posts

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

#10
pehera

pehera

    InsanelyMac Protégé

  • Members
  • Pip
  • 19 posts
  • Gender:Male
  • Location:Denmark
Try this little genius app
http://www.dragonone...sx/pleasesleep/

#11
helob

helob

    InsanelyMac Geek

  • Members
  • PipPipPipPip
  • 218 posts

Try this little genius app
http://www.dragonone...sx/pleasesleep/


Tks for your suggestion. Actually I managed to get sleep working with RIP.app.
I just want to know how to fix the problem without installing additional app.

#12
shockre

shockre

    InsanelyMac Protégé

  • Members
  • Pip
  • 26 posts
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

#13
d00d

d00d

    InsanelyMac Sage

  • Members
  • PipPipPipPipPipPip
  • 479 posts
  • Gender:Male
  • Location:MHT, HYA

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


#14
KWS

KWS

    InsanelyMac Protégé

  • Donators
  • 79 posts
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 ... :)

#15
d00d

d00d

    InsanelyMac Sage

  • Members
  • PipPipPipPipPipPip
  • 479 posts
  • Gender:Male
  • Location:MHT, HYA

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?

#16
jamonda

jamonda

    InsanelyMac Protégé

  • Members
  • PipPip
  • 94 posts
  • Gender:Male
  • Location:Brazil
Will the system sleep when I'm typing, using internet etc. or only after idle timeout?

#17
KWS

KWS

    InsanelyMac Protégé

  • Donators
  • 79 posts

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) ...

#18
krokko

krokko

    InsanelyMac Protégé

  • Members
  • Pip
  • 6 posts
thanks, the script works fantastic . :(

#19
keypox

keypox

    InsanelyMac Sage

  • Members
  • PipPipPipPipPip
  • 322 posts
  • Location:Somewhere out there
thanks man works well

#20
LS8

LS8

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 573 posts
  • Gender:Male
  • Location:Reality Distortion Field
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? :)





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

© 2015 InsanelyMac  |   News  |   Forum  |   Downloads  |   OSx86 Wiki  |   Mac Netbook  |   PHP hosting by CatN  |   Designed by Ed Gain  |   Logo by irfan  |   Privacy Policy