Now, whenever you sleep your machine, the external drives will be ejected automatically when the machine wakes again, all connected external drives will be reconnected. Next, open the Terminal (Applications, Utilities, Terminal), and type the following: usr/sbin/diskutil list | grep -e ' ++: ++ +' | sed 's/. Save the file – call it “sleep.txt”, and save it to the Desktop make sure it’s plain text! Then put the following in another file, called “wakeup.txt”, saved to Desktop too (also just two lines): Osascript -e 'tell application "Finder" to eject (disks where free space ≠ 0)' Pull up your favourite text editor and paste the following in (should be just two lines): Next, you’re going to create ~/.sleep and ~/.wakeup files which SleepWatcher will call upon. It’s all thanks to a little utility by Bernhard Baehr called SleepWatcher, which runs in the background and is triggered by sleep and wake events, calling scripts to perform required actions.ĭownload and install SleepWatcher and its StartupItem. Disk are also reconnected automatically on wake, for when you’re just sleeping the computer without going places. 15 You can use the in-built AppleScript solution, as mentioned in this thread and this page, by adding this to /. Thus, when you remove the drive correctly, all your data gets saved, and the system stops transmission. With a little bit of Terminal magic, you can automatically eject disks when you sleep the laptop, meaning you can just put the lid down and go. Using a laptop with permanent external drives can be a bit annoying when you leave the desk – you have to manually eject all your devices, otherwise you get that dreaded ‘Device Removal’ dialog.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |