How to not be glued to your computer until 3 am, and actually get sleep

The Problem

It’s midnight. “Time for bed!” you tell yourself.

You would totally head off for bed, except you happen to be splat in the middle of an internet article. (Or cat video. Or League of Legends match. Or whatever). So you tell yourself you’ll sleep once you finish that article.

You finish it, and it’s still not that late. Great! Except you clicked a link while you were reading, and now you’ve got a new tab with an enticing new article in front of you, which you could wait until tomorrow to read… or that you could just read right now. (It’s not that late yet, after all!)

“Okay”, you think. “I’ll finish this article, and then I’ll go to sleep”. And you finish, but along the way you’ve opened two new articles, both of them imploring you to read them before you go snuggle in your sheets.

On and on this goes, until you check the time and holy crap it’s 3 am already??

There’s a fundamental problem here—leaving your computer and going to bed requires willpower, while continuing to read is just a matter of switching tabs and getting immediate gratification that your brain so adores. Every time you have to decide what to do, you’ll pick the path of least resistance, which will virtually always be to stay up reading.

A Solution

If we could make our path of least resistance be to get up and sleep, instead of continuing to stay up reading, our problem would be solved.

There’s actually a very simple way to make this happen: configure your computer to automatically hibernate at a fixed time each night.1 This way, the default path is for your computer to shut off, and for you to go to bed. Staying up to continue reading will require the conscious effort and inconvenience of turning your computer back on and waiting for it to reboot.

The beauty of this approach is that it doesn’t force you to do anything you really don’t want, yet always gets you making the correct decision. If you were only reading random internet articles, you probably wouldn’t have the motivation to turn your computer back on just to continue reading those articles. But if you were working on something important that does require you to stay up later, you only have to wait a minute or two before you can resume your task.

Implementation

For Windows, just follow the steps at this link, but ignore step 1, and under Program/script on the “Start a program” tab, enter “c:windowssystem32shutdown” (with no quotes), and under Add arguments (optional) add “/h” (also with no quotes).

I have nothing for Macs. If you have instructions for Macs, please leave a note in the comments.

For Linux, you do something with cron and pm-hibernate and something about admin rights for auto-scheduling a task that requires root privilege, whose details I’ve totally forgotten. If you can jog my memory here, I’d also appreciate if you could leave a comment.


1. For those unaware, hibernation is like making your computer go to sleep (like when you close your laptop), except your computer shuts off. When you reboot, everything that was previously in working memory—all your open programs, unsaved work, etc.—gets loaded back.)

5 thoughts on “How to not be glued to your computer until 3 am, and actually get sleep

  1. Jamie Fox

    The same effect can be had on mac with a simple crontab:
    1) In terminal, type “crontab -e”
    2) Add the following to the file that opens:


    * * * pmset sleepnow
    3) Save the file

    Reply
  2. Nathan

    For Macs, the relevant utility is called pmset. The manual is quite good. Here’s an example command that schedules going to sleep at 11PM every night:

    sudo pmset repeat sleep MTWRFSU 23:00:00

    Reply
  3. timothyzchu

    Alex, I’m not really convinced. Similar tools like flux, chrome extensions blocking the web, and so on have all seen wide use, and in my experience and the experience of others I observe, these ‘patches’ are usually just band-aids on a bigger underlying problem. They work for about two weeks before a new habit forms around them — I would expect that most people who try this will simply end up disabling this hack once it becomes routinely inconvenient

    Reply
  4. zhukeepa

    Jamie and Nathan: thanks a lot!

    Tim: one difference is that many of those other hacks *force* you off, and WILL become routinely inconvenient. They annoy you enough that you often have good reasons for disabling them. This approach, on the other hand, only adds a trivial inconvenience. If you know fairly reliably that at 12:30 am you’re not doing important work and are probably just reading stuff online, this will nudge you off, but never make you feel like you were forced to stop—you might even feel *thankful* that it’s getting you more shut-eye. If you ARE doing work, it’ll take only a minute of waiting to resume. (That also wouldn’t happen too often, since we stipulated you’re usually not doing work at 12:30 am.)

    I think a likelier failure mode, rather than disabling it and forgetting it forever, is finding the reboot time too SHORT and actually going through the effort of rebooting just to waste time online. One way I’ve guarded against this is by setting auto-hibernate times at 30-minute intervals from 12:00 am through

    am, so if my id cruises me past the 12:00 am wait time, there are still a lot of guards against staying up til

    am.

    Reply

Leave a Reply

Your email address will not be published.