Jump to content

Autosleep-Script


  • Please log in to reply
164 replies to this topic

#61
miliuco

miliuco

    InsanelyMac Sage

  • Donators
  • 396 posts
  • Gender:Male
  • Location:Spain
Thank you very much, I'll try and comment.

#62
fft2d

fft2d

    InsanelyMac Protégé

  • Members
  • Pip
  • 7 posts
Thx, I will try and comment it soon.

#63
KWS

KWS

    InsanelyMac Protégé

  • Donators
  • 76 posts
Stop ...
wrong direction ... :wacko:
i added the unchanged script ...try this one ...

Attached File  RIP3lanS.app.zip   29.9KB   37 downloads

#64
miliuco

miliuco

    InsanelyMac Sage

  • Donators
  • 396 posts
  • Gender:Male
  • Location:Spain
Ok, downloaded. Thanks.

#65
KWS

KWS

    InsanelyMac Protégé

  • Donators
  • 76 posts
This is a safer version: no problems with cpu usage or such things ... ?
These lines

set filePath to path to home folder from local domain as string
set x to filePath & "Downloads:" as alias
tell current application
set theSize to size of (info for x)
delay 3
set theSize2 to size of (info for x)
if theSize = theSize2 then
else
return
end if
end tell

compare the download-folder-size in home-directory within 3 s, so every download should be detected ... :D

Attached File  RIP3lanS2.app.zip   30.31KB   34 downloads

#66
miliuco

miliuco

    InsanelyMac Sage

  • Donators
  • 396 posts
  • Gender:Male
  • Location:Spain
Clever!

Your last RIP3lan with safari check works like a charm, if Safari is open and download is finished the PC goes to sleep (since CPU usage is less than 2%) but if download is active (cpu usage fluctuates from 1-2 to 20%) it goesn't.

I've already thought about to check something into the Safari downloads folder (files ending with .download appearing...) but your approach is better. I'll try and comment here.

What I haven't found is how to check from Applescrip (or shell script) if Safari downloads are finished.

Great job, kws, this is an different approach to an specfic sleep problem common in hackintosh. I have to give publicity to your script between spanish people, it may be usefull.

EDIT: entry about this in my blog.

EDIT: RIP3lanS2 works well, it checks the download folder and its subfolders, the PC goes to sleep as expected. Thanks.

#67
KWS

KWS

    InsanelyMac Protégé

  • Donators
  • 76 posts
Hello miliuco

Thank you for your support and ...
Feliz Navidad y un Feliz Año Nuevo :)
KWS

#68
aleister Crowley

aleister Crowley

    InsanelyMac Protégé

  • Members
  • PipPip
  • 76 posts
The RIPLanS2 Script does nor prevent Sleep when download with jdownloader ?

Strange.. jdownloader produce some CPU load and Network Activity so it shouldnt sleep.

Can you take a look into it please ?

#69
KWS

KWS

    InsanelyMac Protégé

  • Donators
  • 76 posts

The RIPLanS2 Script does nor prevent Sleep when download with jdownloader ?

Strange.. jdownloader produce some CPU load and Network Activity so it shouldnt sleep.

Can you take a look into it please ?


"compares the download-folder-size in home-directory", that means: download your Files to this directory, and the script will prevent sleep. You (or jdownloader with standard settings) have probably choosen a different directory for your downloads ...

#70
aleister Crowley

aleister Crowley

    InsanelyMac Protégé

  • Members
  • PipPip
  • 76 posts

"compares the download-folder-size in home-directory", that means: download your Files to this directory, and the script will prevent sleep. You (or jdownloader with standard settings) have probably choosen a different directory for your downloads ...


yes, i know. this should work cause i choose my NTFS Drive. I thought the Script have to stop because jdownloader produce some CPU load up to 15% sometimes?
I will use the Home/Download Folder now, THX

But maybe a Function to "generally" Monitor Internet Down/Upload would be usefull.
"Network" Media (with Samba Streaming) Traffic stops the Script without Problems so far, why not Internet Traffic ?

#71
KWS

KWS

    InsanelyMac Protégé

  • Donators
  • 76 posts

yes, i know. this should work cause i choose my NTFS Drive. I thought the Script have to stop because jdownloader produce some CPU load up to 15% sometimes?
I will use the Home/Download Folder now, THX

But maybe a Function to "generally" Monitor Internet Down/Upload would be usefull.
"Network" Media (with Samba Streaming) Traffic stops the Script without Problems so far, why not Internet Traffic ?


Because i dont know which prog (part of OS) is responsible for Internet traffic. Outgoing traffic = Finder, Incoming = AppleFileServer (hope i dont confuse it :D), but "Internet" traffic ... ?? ...;)

#72
miliuco

miliuco

    InsanelyMac Sage

  • Donators
  • 396 posts
  • Gender:Male
  • Location:Spain
I agree, it's not easy to find which process is responsible for Internet traffic. At least I don't know it.

aleister Crowley: if you download all in home/downloads, you can create some folders there for each downloading application (Safari, JDownloader...), the script checks the folder and its subfolders.

#73
aleister Crowley

aleister Crowley

    InsanelyMac Protégé

  • Members
  • PipPip
  • 76 posts

Because i dont know which prog (part of OS) is responsible for Internet traffic. Outgoing traffic = Finder, Incoming = AppleFileServer (hope i dont confuse it :P), but "Internet" traffic ... ?? ...:P


What i mean is that jdownloader for example produce "Traffic". But the Script forces Sleep. Shouldnt the Script stop?
It works fine with other Network Activities like Streaming, utorrent etc. Why not jdownlaoder Traffic?

#74
dino7777

dino7777

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 111 posts
PleaseSleeep hidden features
do not sleep if CPU idle state is less than x


to all you who use PleaseSleep as I do.
I have talked to the developers and you can add some hidden feature to prevent sleep if CPU activity is more than x.

Just edit its plist in User/You/Library/Preferences/com.dragonone.PleaseSleep.com and add keys
"CPULoad" as Boolean , and "CPUThreshold" as integer, if not already in the plist.

or use terminal with

$ defaults write com.dragonone.PleaseSleep CPULoad -bool true

$ defaults write com.dragonone.PleaseSleep CPUThreshold -int 3


As this is unsupported, you should check what CPUThreshold value is right for you.
I use value 3, that ensures that my system does not sleep if Finder does some copying work and/or some download jobs are still active.

Restart the app to make it read new values!


Hope this will help anybody, as it helped me.

Cheers

#75
aleister Crowley

aleister Crowley

    InsanelyMac Protégé

  • Members
  • PipPip
  • 76 posts

PleaseSleeep hidden features
do not sleep if CPU idle state is less than x


to all you who use PleaseSleep as I do.
I have talked to the developers and you can add some hidden feature to prevent sleep if CPU activity is more than x.

Just edit its plist in User/You/Library/Preferences/com.dragonone.PleaseSleep.com and add keys
"CPULoad" as Boolean , and "CPUThreshold" as integer, if not already in the plist.

or use terminal with

$ defaults write com.dragonone.PleaseSleep CPULoad -bool true

$ defaults write com.dragonone.PleaseSleep CPUThreshold -int 3


As this is unsupported, you should check what CPUThreshold value is right for you.
I use value 3, that ensures that my system does not sleep if Finder does some copying work and/or some download jobs are still active.

Restart the app to make it read new values!


Hope this will help anybody, as it helped me.

Cheers


mhh.. i dont have this .plist on SnowLeo. so the Terminal commands wont work

but wait, you dont mean this Script here? You mean the App Please Sleep ? I made a Test with this App and this Script works by far better/more Vanilla

#76
dino7777

dino7777

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 111 posts
yes I do mean the app PleaseSleep.
Vanilla or not, PleaseSleep is free of charge and does its job. U get a nice gui, and with this additional settings I decribed, one has all to set up sleep for his/her needs.
Even some "real" Macs have issues with sleep; therefore the question is not vanilla or not, but if it does the job.

#77
zim2dive

zim2dive

    InsanelyMac Protégé

  • Members
  • PipPip
  • 98 posts
I'm not knocking the various scripts.. they are helping a lot of ppl. Just wanted to post that for me.. I found that the inability to auto-sleep was due to fakeSMC.. I tried all 3(?) versions I found floating around (2.5, v454, v3.0) and with version 454, I suddenly had auto-sleep again. I can't give an explanation... just relaying what I'm seeing in case it might help someone else. Note: I do not have an internal DVD player (external.. and its always off), but even with SleepEnabler I had lost auto-sleep 2-3 10.6.x updates back.

#78
KWS

KWS

    InsanelyMac Protégé

  • Donators
  • 76 posts

yes I do mean the app PleaseSleep.
Vanilla or not, PleaseSleep is free of charge and does its job. U get a nice gui, and with this additional settings I decribed, one has all to set up sleep for his/her needs.
Even some "real" Macs have issues with sleep; therefore the question is not vanilla or not, but if it does the job.


Free of charge?:
"If you use PleaseSleep and are happy with it, we would love if you would consider donating."
From your comment i suspect that you are "happy with it". As i wrote my scipt, I had no knowledge of this program. Anyway, i think a "nice gui" isn't necessary for this job ... :glare:

#79
dino7777

dino7777

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 111 posts
I did send them a "gift" of 10USD.
And the testing of the "hidden" feature was also my good will.

If I like software, I pay for it. Look at my signature; I even "switched" to real macs too.
My guess is that Apple likes Hackintosh, as there r lost of people like me, who first use hack than buy mac.

Can you please send the command, that proofs CPU load?
I like your skript, but pleaseSleep (as donation ware) is my favorite :glare:

Cheers

#80
KWS

KWS

    InsanelyMac Protégé

  • Donators
  • 76 posts

I did send them a "gift" of 10USD.
And the testing of the "hidden" feature was also my good will.

If I like software, I pay for it. Look at my signature; I even "switched" to real macs too.
My guess is that Apple likes Hackintosh, as there r lost of people like me, who first use hack than buy mac.

Can you please send the command, that proofs CPU load?
I like your skript, but pleaseSleep (as donation ware) is my favorite :P

Cheers

So its not yet free of charge? Look, if you want to spend some time, use it for developing your own scripts or apps instead of trolling around ... :(





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

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