Skip to content

Running blocks longer than 24 hours

Charlie Stigler edited this page May 18, 2021 · 1 revision

Read this closely. If you do it wrong, SelfControl will not launch.

By default, SelfControl will not allow you to run a block for longer than 24 hours. This is for your own good: if you run a long block, you will probably realize, about 3 days into your year-long block, that oops you accidentally blocked one website you really need. SelfControl does not have an undo button - if you start a long block, you are stuck with it until the timer runs out. If you're sure you really need a longer block, test it first for 24 hours, then run it for longer only if it worked great in that 24-hour period.

To adjust the maximum block duration, open Terminal.app in Applications --> Utilities, then enter the following commands (substituting the words in brackets with numbers). Press enter after each line. The exact commands vary by SelfControl version:

Version 4.0 and above

defaults write org.eyebeam.SelfControl MaxBlockLength -int [maximum block length in minutes]

So, for example, to change it to a month-long maximum block, you could use:

defaults write org.eyebeam.SelfControl MaxBlockLength -int 43200

Version 3.0.3 and below

defaults write org.eyebeam.SelfControl MaxBlockLength -int [maximum block length in minutes]
defaults write org.eyebeam.SelfControl BlockLengthInterval -int [block length interval in minutes]

So, for example, to change it to a month-long maximum block with intervals at each day, you could use:

defaults write org.eyebeam.SelfControl MaxBlockLength -int 43200
defaults write org.eyebeam.SelfControl BlockLengthInterval -int 1440

Oops, I Made a Typo

If you made a typo in the above commands and messed up your settings, use this Terminal command (while SelfControl is closed) to reset your SelfControl settings:

defaults delete org.eyebeam.SelfControl

The above command does not remove a running SelfControl block. It only resets settings like MaxBlockLength.

Automating Stop/Start Times

These methods were not created by the SelfControl authors, and are not officially supported. We provide this information only as a courtesy - use these tools at your own risk.

Automate with an AppleScript

Karl James Pestka wrote an AppleScript to automate SelfControl. Information on it is on macosxhints.com.

Automate with Python Script

Andreas Grill wrote a "small utility to schedule start and stop times of SelfControl" and it's available on github.