Skip to content

Instantly share code, notes, and snippets.

@bobisme
Created March 28, 2013 09:21
Show Gist options
  • Save bobisme/5261876 to your computer and use it in GitHub Desktop.
Save bobisme/5261876 to your computer and use it in GitHub Desktop.
Mac has been acting stupidly since I upgraded to 10.8. My VM has been crashing when it sleeps and I've been told that skype is always switching between "online" and "offline". So... Do this instead of just sleeping.
#!/bin/sh
VM="Ubuntu Server"
function wakefunc {
VBoxManage startvm $VM
osascript -e 'tell application "Skype" to send command "SET USERSTATUS ONLINE" script name "wakescript"'
}
function sleepfunc {
VBoxManage controlvm $VM savestate
osascript -e 'tell application "Skype" to send command "SET USERSTATUS OFFLINE" script name "sleepscript"'
osascript -e 'tell application "Finder" to sleep'
}
case "$1" in
wake)
wakefunc
;;
sleep)
sleepfunc
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment