Sick and tired of staying up late because of your mac? Schedule it to be shutdown during sleep hours
Are you sick and tired of staying up late because of your mac? This script suggests you to wind down using customizable voice annoucements. If your mac is still on during sleep hours - this script will shut your mac down for you. You are welcome.
Warning: Before you install, please understand that it might be hard to turn the computer back on during sleep hours. Every time the computer is turned on, you will have 1 minute to disable it from shutting down your computer.
In your terminal run:
echo "Cloning the repo"
git clone https://github.com/bra1nDump/kill-my-mac.git
cd kill-my-mac
echo "Setting up"
./install.sh
TODO: Currently you can change the sleep hours to be closer to current time in the shutdown-job.sh script. You can also change the warning times.
I got you! How agressive?
osascript -e 'tell application "System Events" to shut down'
You can do either option:
rm ~/Library/LaunchAgents/com.bra1ndump.kill-my-mac.plist
, this will prevent the script from running. You can run ./install.sh
to enable again./uninstall.sh
. Same as above.osascript -e 'tell application "System Events" to shut down'
. Uncomment it again to re-enablels ~/Library/LaunchAgents
pmset
), do nothingosascript -e 'tell application "System Events" to shut down'
Package with Homebrew tap
Allow configuring sleep time - will need to symlink the cli bash script that will update the configurations so its accessible from anywhere
How can I make editing the configuration difficult?
By allowing to skip the shutdown once by looking at a message to self you wrote when setting this up, and forcing to look at it for 5 minutes before allowing to skip
Maybe switch to python? Since it will be installed by brew, I can just set python as a dependency. Its installed everywhere already so does not really matter. Bash is fucking ridiculous. Functions are unlike in any other programming language
pmset repeat shutdown TWRFS 11:00:00