Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Run this script just before you put the laptop in the bin for security scanning.
- # You can add the seconds the laptop will be waiting before speaking. The default
- # is waiting for 180 seconds (3 minutes).
- # Switch to the login screen, effectively locking the screen.
- function lockscreen() {
- /System/Library/CoreServices/"Menu Extras"/User.menu/Contents/Resources/CGSession -suspend
- }
- function voice() {
- echo "Locking screen now..."
- sleep 1; lockscreen
- sleep $1; echo "Hit Ctrl-C to interrupt the voices."
- osascript -e "set Volume 10"
- while :; do
- # You could be creative here!
- sleep 5; say -v Bell -r 50 dong dong
- sleep 1; say -v Victoria -r 100 "I don't belong to you"
- done
- }
- function volume_off() {
- osascript -e "set Volume 0"
- echo; echo "Turned volume off."
- exit
- }
- trap volume_off INT
- wait=$1
- if [[ $# -lt 1 ]]; then wait=180; fi
- echo "Caffeinated. Waiting $wait seconds then starting voice..."
- caffeinate -i & voice $wait
- # caffeinate doesn't always work. InsomniaX seems to interfere.
- # In such a case you have to disable sleep manually.
Add Comment
Please, Sign In to add comment