![]() If your needs are the same as mine, I think you'll find it well worth the few bucks they charge. This has very quickly become one of a small handful of utilities I can't live without. I've found a small and inexpensive app that does this very well so far: Jettison. I created it, because my Logitech Bluetooth Mouse doesn't stay connected after sleep-mode, so i had to manually re-pair my mouse. You can use the script as shortcut to restart Bluetooth on demand or you can use it with 'SleepWatcher' to automatically restart Bluetooth on wakeup (See README.md). In my case I don't need to run arbitrary scripts, but instead just eject external drives. Download ZIP Restarts Bluetooth Module on Mac OS X. UPDATE I have not found sleepwatcher to be consistently reliable since originally writing this answer, although it initially appeared to be working. I'll keep testing and if I find it to not work sometimes I'll update my answer, and keep testing other options. On the other hand, in my tests (so far) sleepwatcher has appeared to be quite reliable and fast. The low-level performance just doesn't seem to be there, however, for running a script before sleeping. ![]() I'm sorry to have to say that it failed, however, because in so many respects it is a really nicely designed and quite powerful and flexible program. I hope to save you and anyone else reading this the hours of testing it took me to come to this conclusion. Although it is a very impressive program which I would recommend in general, after testing it for this purpose it does NOT actually appear to be able to trigger scripts quickly enough for them to run before your Mac goes to sleep, and instead the sleep script will not run until after the Mac has woken up, which (obviously) defeats the purpose. If you use 'fast user switching' to sleep you will find that scripts which require a logged in user will attempt to run too early and fail unless you modify the Launch Daemon - perhaps grep 'Succeeded' in 'secure.log'.Īnother program which you might discover and be tempted to try is EventScripts. The file is cleared by a log 'Sleep' entry and by Shut Down. The Launch Daemon watches and writes to a temporary file provided the file is empty. To do this I listen for when the mac goes to sleep and disable the Wi-Fi. My Launch Daemon resides at /Library/LaunchDaemons/ist Help improve this post When I am on a network that’s paid by the hour you want to disable your Wi-Fi when you are not using your mac. You may need to increase 'ExitTimeOut' for some scripts. I write a date to z but you could change this to write anything. Tail -1 /Library/Logs/DirectoryService/ | grep -v Sleep || > $z ![]() I developed the following simple Launch Daemon to provide a 'wake' trigger for scripts on Leopard:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |