SleepWatcher - 2.0.5execute shell scripts upon sleep, wakeup, idleness |
|
||||||||||||||
|
|||||||||||||||
Feedback Summary:
| This Version: | |||||
| Overall Rating: | Not rated (0.0) | Features: | Not rated (0.0) | Support: | Not rated (0.0) |
| Ease of Use: | Not rated (0.0) | Quality / Stability: | Not rated (0.0) | Price: | Not rated (0.0) |
Key to Types of Feedback:
Reviews
Troubleshooting
Usage Tips
Developer Notes
Commentary
Featured Reviews
Wake from sleep before/to enable scheduled shut down - Version: 2.0.5, 4/6/2008 06:57PM PST
Mayitbe4u
Fantastic application! - Version: 2.0.4, 5/29/2006 01:05PM PST
brehob
I've thought for a long time that MacOS should have this capability built in. Besides the SMB shares that disappear on sleep (what's up with that!?), I have other applications that should exit before sleep and start again on wake. I'm glad that SleepWatcher runs shell scripts instead of AppleScripts, although I can see how others would prefer the other.
For anyone having looking for a simple script for mounting and unmounting SMB shares, here's what I use: Create $HOME/.wakeup with this:
#!/bin/sh # # This file should be $HOME/.sleep and $HOME/.wakeup. # This is run by "SleepWatcher" through /etc/rc.sleep and /etc/rc.wakeup # I've made this one file to keep things consistent. # # BSD echo command needs this for escape sequences. test "$SHELLOPTS" && shopt -s xpg_echo tel="tell application" case $0 in *sleep) echo "$tel 42Finder 42 to eject 42share 42" | osascript - ;; *wakeup) echo "$tel 42Finder 42 to mount volume 42smb://s/share 42" | osascript - ;; esacThen run "ln .wakeup .sleep" to make them the same file. Wayne
Excellent utility 



- Version: 2.0.3, 1/11/2006 10:56PM PST
grikdog
#!/bin/sh
osascript -l AppleScript -e 'tell Application "Finder" to say "Just going to sleep now, ok?"'
(Don't enter these lines ;-)
Save the file as ~/.sleep and wait about 5 minutes for your screensaver to launch. Listen.
That's it. The rest is only limited by imagination. For starters, study the man page: man sleepwatcher Then open /Library/StartupItems/SleepWatcher/SleepWatcher in TextEdit and find the line that starts SleepWatcher. The man page suggests that you can do A LOT MORE than minimum, but the default configuration is powerful.
In my own .sleep file I launch a script to fire off the PostgreSQL dumpall command, if it hasn't run yet. Screensaver time is the perfect time to make a database backup, at least for small personal databases.
How To Get Started? - Version: 2.0.1, 6/8/2005 06:04PM PST
iminds
TIA
Most Recent Replies: View All 1 Replies
- How To Get Started?
Perfect! 



- Version: 2.0, 5/7/2005 12:50AM PST
MacManux
Good stuff, and for those who are interested, I use it to start Automator commands to mount/unmount the drive, by issueing a
open /path/to/my/AutomatorCommand
which I had saved as an Application.
Most Recent Replies: View All 1 Replies
Excellent Tool! 



- Version: 1.0.1, 4/15/2004 04:14PM PST
(1 of 1 users found this comment useful)
lacrizJust write something like
open "Desktop/wakeup.mp3"
in your ~/.wakeup file and create an alias of some mp3 on your Desktop. Next time your mac awakes from sleep, you too will ;)
You can even create an alias of some movie file on your Desktop and rename it to "wakeup.mp3" and be wakened by your favourite movie.. endless possibilties :D
Maybe this helps those having problems writing working .wakeup/.sleep scripts:
Be careful to leave a blank line at the end of each script! otherwise the last line of the script might not get executed. Also save your scripts with Unix-style line breaks. You could do so with BBedit or for free: pico, vim, emacs.. (just type pico .wakeup in Terminal)
Also having troubles - Version: 1.0.1, 9/25/2003 12:36AM PST
ShadoFlameX
That Dog Don't Hunt - Version: 1.0.1, 9/7/2003 09:14PM PST
annstringer
That Dog Don't Hunt - Version: 1.0.1, 9/7/2003 09:13PM PST
annstringer
Just what the doctor ordered 



- Version: 1.0.1, 7/23/2003 06:06PM PST
Catservant
osascript -e 'tell application "Finder" to eject (every disk whose local volume is false)'
Cons: Documentation needs improvement (although the samples are helpful) and a graphical user interface would be a definite plus.