slowvilla.blogg.se

Newbienudes sleepwatcher
Newbienudes sleepwatcher










newbienudes sleepwatcher

In order to have the Sleep Watcher run at all times, you need to make it a LaunchDaemon. You can now cancel the Sleep Watcher by pressing Ctrl C in Terminal.

newbienudes sleepwatcher

Did RDP close? Great! Did something go wrong? Look at the output of the sleepwatcher command to get a hint about where it failed. Wait a couple of seconds until it really goes to sleep. This will not output anything, so leave both RDP and the Sleep Watcher running, then close the lid of your MacBook. Now test your script by first starting the RDP program, then running the following in Terminal: /usr/local/sbin/sleepwatcher -verbose -sleep ~/.sleep Now we need to make it executable: chmod +x ~/.sleep You can do this with any application as long as you change the name according to its title. This will quit the Microsoft RDP application through AppleScript commands. In this file, add the following: osascript -e 'tell application "Remote Desktop Connection" to quit' It will contain the commands that are run when the machine is put to sleep (i.e. Now, let's create a sleep script called ~/.sleep.

newbienudes sleepwatcher

You will be prompted for an administrator password.

NEWBIENUDES SLEEPWATCHER INSTALL

This will install the sleepwatcher binary and the manpages. Sudo cp ~/Desktop/sleepwatcher_2.2.1/sleepwatcher.8 /usr/local/share/man/man8 Sudo cp ~/Desktop/sleepwatcher_2.2.1/sleepwatcher /usr/local/sbin Download the tool from Bernhard Baehr's homepage and follow the installation instructions: assuming you unpacked the download to your Desktop, call the following commands from a Terminal window: sudo mkdir -p /usr/local/sbin /usr/local/share/man/man8 Sleep Watcher, free and open source, but command line.Scenario and Power Manager, both commercial and GUI tools.There are a couple of tools that allow you to intercept OS X' power status changes:












Newbienudes sleepwatcher