Hacker News new | past | comments | ask | show | jobs | submit
I would love it if my laptop had a "study mode" for when I am trying to debug something or learn something new using my laptop. Some of us have less than stellar self-control, so a study mode which requires a multi-step rigamarole to shut off might prevent me from casually checking my email or a news website when I am supposed to be learning a new data structure or figuring out a data corruption bug. I have no idea how it would work in real life: I need access to the internet to lookup API documentation, download libraries, and read online books, but I imagine something could be worked out.

(This article mentions that not only are cell phones banned at the featured school, but these kids have hobbled laptops that supposedly help them focus on school work, although the imperfect nature of the hobbling has unintended consequences).

A combination of https://selfcontrolapp.com/ and Hammerspoon automation and you can lock yourself out of pretty much everything.
I managed to build myself exactly this with Claude's help. There are 3 levels of protection.

1. I use an app called SelfControl, which blocks websites temporarily.

2. I have a script which watches `/etc/hosts` with launchd and reverts it to a version pulled from a server if the file changes. This blocks websites I never want to go to.

3. I setup a 'focus mode' with hammerspoon prevents me from launching certain apps, and makes me wait 30 seconds and type a string of text when I want to switch it off.

Yes, all of these things can be disabled when I want to, but the point is that they all add some fiction and give me a chance the reconsider the distracting action I was about to take.

I've been doing it for about 2 weeks, so far it's working pretty well!

Create a separate Mac / Windows non-admin account just for coding? I’m sure there are parental control measures for either platform. As time goes you can update the deny list of web sites.

Another thing that helps is recording your screen for the whole day. Once you start doing review in the evening it will create back-pressure on the monkey brain that jumps to distractions.

Yet another thing is to setup a separate computer. You can browse crapnet as long as you want, but you have to walk to another desk. The back pressure is subtle but has long-term effect and requires very kittke will power.

>Create a separate Mac / Windows non-admin account just for coding?

Yes, I got as far as creating a separate account on my MBP a few years ago and I do programming and open source stuff with that account. And it has helped quite a bit! Although it's not perfect (case in point, I am here on HN right now).

Here is how it would work in real life:

The laptop would come with a study mode button.

You would push it and turn off distractions.

Then 5 minutes later you would disable it just to send a chat.

Then since it was off, you'd just quickly check TikTok.

Then while you're at it, it just a quick break, you'd pop over to Twitch.

3 hours later...

If you can't teach yourself restraint, a button won't help.

loading story #47457213
loading story #47457431