Created
October 30, 2013 00:28
-
-
Save Velrok/7225196 to your computer and use it in GitHub Desktop.
A bash script for mac that uses an apple script to put the mac to sleep without the need to enter the password.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ -n "$1" ] | |
then | |
minutes=$(($1 * 60)) | |
echo "going to sleep in $1 minutes" | |
sleep $minutes | |
fi | |
echo "sleeping now" | |
osascript -e 'tell app "Finder" to sleep' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment