Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

DaSal

macrumors 6502
Original poster
Mar 19, 2008
308
247
The Netherlands
I've been looking for a way to run a script or application every time my Mac wakes up from sleep. However it's proving to be surprisingly difficult.

The only option I seem to be able to find is SleepWatcher, which runs from the command line, I guess, and I can't seem to find any documentation on it. Well, at least none that actually gets it working. If anybody can tell me how to get it working, that'd be great too.

What I actually need is for my Mac to run the following script on wake:

#!/bin/sh
curl --get "http://127.0.0.1:3000/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=XBMC.updatelibrary(video)

If anybody knows how to get it to do that, that'd be great :)
 
I want to do something similar. Specifically I want to quit, then re-open an application upon wake from sleep. I've installed SleepWatcher, and have a .wakup script that I've put in my home directory, but it doesn't appear to run. Can't find any documentation beyond the (unhelpful) man page.

p.s. also I'm not so sure my script works either...
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.