No. Stop. Don’t fucking do that. “Automate mundane tasks you tend to not bother with” is way better advice.
Today I re-discovered the magic that is the pmset command. It allows you to programmatically put your computer (or just its display) to sleep, schedule sleep/shutdown/wake/boot times, and much more! Last time I read anything about it was years ago, way back when I wasn’t as much of a “super hacker” as I am now. Meaning, I can actually think of legitimate uses for it!
I use the MacPorts package manager for, well, managing some software packages. It has a command to automatically update everything you’ve installed to its latest version, but if you forget to do that for a while it can take some time. Especially when it means rebuilding larger software like compilers, you’ll be looking at 100% CPU use for a solid five to ten minutes. Keeping everything up-to-date is something I tend to forget, and having it running in the background while I’m trying to do other things isn’t exactly the best of ideas I can think of.
So what about pmset again? I’ve written a short little sequence of commands that will first sleep my display, then kick the package updating into gear, and sleep my computer once that has finished. That way I can just kick it off before I go to bed, let the whirring of the fans sing me to sleep, and not have to worry about needing to shut the thing down myself. Convenience!
What’s that, I could’ve just let it sleep after half an hour of idling? Idling’s for chumps and auto-sleep is for wimps. Get with the program.