Last active
November 1, 2020 10:23
-
-
Save dkarmalita/c2bdec0181ca7dc81902138d004f34ad to your computer and use it in GitHub Desktop.
Caff * OSX caffeinate advanced
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
#! /usr/bin/env bash | |
# kard, 20201020, https://gist.github.com/dkarmalita/c2bdec0181ca7dc81902138d004f34ad | |
# Run the caffeinate prefaced by date and time stamp. After the script | |
# finished (use "q" key), it cleans all of the caffeinate processes. | |
echo Caff starts at $(date "+%H:%M:%S %d/%m/%y") | |
caffeinate -di & | |
n="_" | |
while [ $n != "q" ] | |
do | |
echo "Press q to quit" | |
read -rsn1 n | |
done | |
pkill -9 caffeinate | |
echo Bye-Bye! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment