Jump to content

sleep watcher


  • Please log in to reply
6 replies to this topic

#1
ytrox

ytrox

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 502 posts
  • Gender:Male
  • Location:Italy
has anyone used sleepwatcher to monitor sleep troubles?

#2
Apfeleimer

Apfeleimer

    InsanelyMac Protégé

  • Members
  • Pip
  • 2 posts
I'm using sleepwatcher to work around three issues:

- Autosleep doesn't work here. sleepwatcher takes care of that and puts the computer to sleep X minutes after the display went to sleep.
- Since some external USB drives aren't properly put to sleep, I tell sleepwatcher to unmount them prior to sleep and mount them again at wakeup.
- As Lion does have some problems reconnecting to my WiFi network, sleepwatcher disables my WiFi card at sleep and enables it at wakeup.

Very handy!

#3
mnfesq

mnfesq

    Emenef, Esquire

  • Members
  • PipPipPipPipPipPipPip
  • 546 posts
  • Gender:Male
  • Location:Southern California

I'm using sleepwatcher to work around three issues:

- Autosleep doesn't work here. sleepwatcher takes care of that and puts the computer to sleep X minutes after the display went to sleep.
- Since some external USB drives aren't properly put to sleep, I tell sleepwatcher to unmount them prior to sleep and mount them again at wakeup.
- As Lion does have some problems reconnecting to my WiFi network, sleepwatcher disables my WiFi card at sleep and enables it at wakeup.

Very handy!


Would you mind posting your scripts for these actions? I have issues with USB after waking from sleep and it sounds like you already have a script that would solve the problem. Thanks.

#4
stp715a

stp715a

    InsanelyMac Protégé

  • Members
  • Pip
  • 2 posts
Using "Please Sleep" with great success on a 10.5.8, 10.6.8, and 10.7.0 builds. Works great with an HTPC on 10.5.8. Very flexible configurability! Sweet app.

#5
Apfeleimer

Apfeleimer

    InsanelyMac Protégé

  • Members
  • Pip
  • 2 posts

Would you mind posting your scripts for these actions? I have issues with USB after waking from sleep and it sounds like you already have a script that would solve the problem. Thanks.

Put the following into your .sleep script located in your home folder to eject a drive called "STICK" right before sleep. The last line delays the sleep for an additional second just to be sure.
if [ -d /Volumes/STICK ]
then
  /usr/sbin/diskutil unmount /Volumes/STICK
fi
osascript -e 'tell application "Finder" to delay 1'
Put the following into your .wakeup script in your home folder to remount the drive called "STICK" again at wakeup.
/usr/sbin/diskutil mount STICK

If you need elevated root privileges for your actions edit rc.sleep and rc.wakeup located in /usr/local/etc/sleepwatcher/ instead. To disable wifi add the following at the end of /usr/local/etc/sleepwatcher/rc.sleep
ifconfig en1 down
and to re-enable it again add the following at the end of /usr/local/etc/sleepwatcher/rc.wakeup
ifconfig en1 up


#6
mnfesq

mnfesq

    Emenef, Esquire

  • Members
  • PipPipPipPipPipPipPip
  • 546 posts
  • Gender:Male
  • Location:Southern California
Thanks Apfeleimer!

#7
King George

King George

    InsanelyMac Protégé

  • Members
  • Pip
  • 49 posts
  • Gender:Male
  • Location:Belgium
Hi,
this is a very interesting thread.
I will certainly use this to eject drives. (Unless someone knows a DSDT fix for USB wake problems on gigabyte sandy bridge???)

I have a question though,
do you think a command could be used to sleep&wake the usb mouse/keyboard?
that would make this a complete workaround solution!!

thanks





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