Fang Talks

They're coming down the stairs.

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.
~ Fang

Comments

  • 02/12/2014 (2:31 AM)

    I have an auto shutdown but I mostly use it when I go to bed in a skype call or something. Or when my iPod is busted and I have to listen to music on my computer and I’m going to sleep. I constantly, constantly put off updating stuff. I’d probably get some use out of an auto-updater-auto-updater.

Post a comment

Your email will stay hidden, required field are marked with a *.

Experimental anti-spam. You only have to do this once. (Hint: it's "Fang")