Last active
December 19, 2015 18:28
-
-
Save thibaultcha/5998651 to your computer and use it in GitHub Desktop.
Bash function to prevent your Mac from sleeping for X hours. Put it in your .bash_profile and call it maybe.
This file contains 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
function coffee() { | |
hours=${1} | |
time=$(( $hours*3600 )) | |
echo "Will prevent sleeping for $hours hours." | |
$(caffeinate -u -t "$time") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment