Skip to content

Instantly share code, notes, and snippets.

@ttaylorr
Created September 2, 2016 19:03
Show Gist options
  • Save ttaylorr/9b7cc4e743e1b5424afec46e59a87a49 to your computer and use it in GitHub Desktop.
Save ttaylorr/9b7cc4e743e1b5424afec46e59a87a49 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
if [ ! "root" -eq "$(whoami)" ]; then
echo "Unable to keep display awake when not running as 'root'."
echo "Try \`sudo !!\` to run this command again as root."
exit 1
fi
echo "[*] Keeping display awake..."
while true; do
pmset schedule wake "$(date -v+1M "+%D %T")"
sleep 60
done
echo "[*] Goodnight."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment