|
|
10.6: Fix sleep problems with SleepWatcher
Generally, I don't think its a good idea to recommend launchd modifications/additions without understanding exactly what they're doing. The reason is that if they cause issues they are difficult to debug for the average user. Especially in circumstances like this where a slight error could cause the computer to continually sleep or shut down.
That being said, although I have not tested this script either, this seems like a valid method of forcing an idle-time based sleep if other methods fail. This could benefit from some explanation as to what the launchd file actually does. First, the option "KeepAlive" will perform the "ProgramArguments" whenever the process sleepwatcher is not running. Similarly "RunAtLoad" will perform the "ProgramArguments" at login.
As for the actual program arguments, they are a bit more complex:
The first line calls an instance of sleepwatcher with three arguments: -V (for verbose logging), -S (to run a command on display sleep), -W (to run a command on display wake)
The -S command will run the command every time the display sleeps. This command launches ANOTHER process of sleepwatcher which is a daemon (-d) that waits for 900 seconds (-t9000) of idle activity (-i) before it performs the command while writing ITS OWN (read: second instance of sleepwatcher) process identifier PID to the file /tmp/sleepwatcherid.
Now, the idle command launches a THIRD instance of sleepwatcher with the single argument -n that tells the THIRD instance of sleepwatcher to cause the computer to sleep and immediately quits the THIRD INSTANCE.
Lastly, the -W command will kill the SECOND instance of sleepwatcher, leaving the first instance running. Finally, I might note that this is very easily removed from launchd with the same effect. By adding a "-d" tag to the FIRST instance (with the four arguments), and calling the entire command from AppleScript, the result will be the same (so long as the script is saved as an application and is added to the login apps). Always make sure that you understand what a script is going to. ---
Manage Mac OSX settings depending on your location - AirPort Location for Mac
10.6: Fix sleep problems with SleepWatcher
So I decided to follow through on Andrew's suggestion and create a user-level application (via Automator in my case since I'm not too script savvy). If anyone is interested, here is what I did:
10.6: Fix sleep problems with SleepWatcher
Hackintoshes? Anyway, getting sleepwatcher to work for me was as simple as putting the following into my ~/.bash_profile file: |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.12 seconds |
|