Existing users, log in.  New users, create a free account.  Lost password?

Mac OS X  |  System / Utilities  |  Maintenance / Optimization  |  SleepWatcher

SleepWatcher

SleepWatcher - 2.0.5

execute shell scripts upon sleep, wakeup, idleness

All Time: (4.7)
This Version: Not rated (0.0)
Current Version: 2.0.5
Release Date: 2007-11-02
License: Freeware
Downloads (this version): 3,648
Downloads (all versions): 1,005

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)
Add Your Feedback

Key to Types of Feedback:

ReviewsReviews   TroubleshootingTroubleshooting   Usage TipsUsage Tips   Developer NotesDeveloper Notes   CommentaryCommentary   Featured ReviewsFeatured Reviews

All Feedback: 1 - 10 of 13 |  1 2 Next



SleepWatcher Troubleshooting ReportWake from sleep before/to enable scheduled shut down - Version: 2.0.5, 4/6/2008 06:57PM PST

Mayitbe4u
I would like a script for that would wake my imac from sleep before its regularly scheduled shut down in "Energy Saver". The problem with Energy Saver is the scheduled shut down never occurs if the computer has gone to sleep mode. One way around that is to not have the computer enter sleep mode--but this is ludicrous and wastes energy rather than saves it. So, again, I need a script that is a work around my objective. Essentially, the script would wake the computer say 5 minutes before the scheduled shut down so that it will indeed get the message to shut down.


Post a commentAlert Admin

SleepWatcher Usage TipFantastic application! - Version: 2.0.4, 5/29/2006 01:05PM PST

brehob
Many thanks to Herr Baehr for such a useful tool!

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 42Finder42 to eject 42share42" | osascript -
  ;;
*wakeup)
  echo "$tel 42Finder42 to mount volume 42smb://s/share42" | osascript -
  ;;
esac
Then run "ln .wakeup .sleep" to make them the same file. Wayne
Post a commentAlert Admin

SleepWatcher ReviewExcellent utility - Version: 2.0.3, 1/11/2006 10:56PM PST

grikdog
What a great idea! As for how to use it... Install the SleepWatcher.pkg, then install the SleepWatcher StartupItem.pkg. Launch TextEdit. Enter these lines:

#!/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.
Post a commentAlert Admin

SleepWatcher CommentaryHow To Get Started? - Version: 2.0.1, 6/8/2005 06:04PM PST

iminds
I want to learn more about startup scripts and using this app but I need some tutorial/lessons to understand what I need to do. Can someone help make this clearer for me to learn? I appreciate any and all help.

TIA
Post a commentAlert Admin

Most Recent Replies: View All 1 Replies

SleepWatcher ReviewPerfect! - Version: 2.0, 5/7/2005 12:50AM PST

MacManux
This tool does exactly what it promises. I can now mount my network drive after wakeup from sleep, and unmount before sleeping - I was searching for this very long. The only other utility with a similar idea behind , ReadyToGoNightNight, does not work propoerly, and never was developed beyond beta.

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.
Post a commentAlert Admin

Most Recent Replies: View All 1 Replies

SleepWatcher ReviewExcellent Tool! - Version: 1.0.1, 4/15/2004 04:14PM PST

(1 of 1 users found this comment useful)

lacriz
Since you can schedule wake-ups in panther, you can now easily let your mac wake you with some music or even with a movie!
Just 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)
Post a commentAlert Admin

SleepWatcher Troubleshooting ReportAlso having troubles - Version: 1.0.1, 9/25/2003 12:36AM PST

ShadoFlameX
I also cannot get my script to run. I was trying to just get sleepwatcher to run an applescript as was desribed in an earlier post. I created a .wakeup file in my home dir. In this file I put "open ~/wakeup.script" and that is all. Then I made an applescript saved it as an app in my home dir and thats it. I have restarted and set the .wakeup script to executable. Can't seem to figure it out. Please help
Post a commentAlert Admin

SleepWatcher Troubleshooting ReportThat Dog Don't Hunt - Version: 1.0.1, 9/7/2003 09:14PM PST

annstringer
Can't get SleepWatcher to work. Created the .sleep text file for the ~ directory, made it executable, pasted in the osascript line from the post below, restarted, mounted two networked drives, executed the sleep command, and nothing happens. Suggestions on steps I've overlooked would be helpful.
Post a commentAlert Admin

SleepWatcher Troubleshooting ReportThat Dog Don't Hunt - Version: 1.0.1, 9/7/2003 09:13PM PST

annstringer
Can't get SleepWatcher to work. Created the .sleep text file for the ~ directory, made it executable, pasted in the osascript line from the post below, restarted, mounted two networked drives, executed the sleep command, and nothing happens. Suggestions on steps I've overlooked would be helpful.
Post a commentAlert Admin

SleepWatcher ReviewJust what the doctor ordered - Version: 1.0.1, 7/23/2003 06:06PM PST

Catservant
This daemon fills a hole in the OS X implementation. I have bee looking for a way to execute "SleepItems" before the computer goes to sleep, analogous to the StartupItems run at system boot. This fits the bill quite nicely. My primary use is unmounting of network volumes before my PowerBook goes to sleep so that I don't have connection problems when trying to access the volumes after wake-up. BTW, it perform the unmounting using a one-line OSA script command (I couldn't get the Finder to recognize dismounts when using the UNIX umount command):

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.
Post a commentAlert Admin