SelfControl for Ubuntu, GitHub to the rescue!

A colleague was wondering if there was a version for Ubuntu of SelfControl, a nice supporting application for those of us suffering from... difficulties focusing, let's say.

Sure enough, there is. Here is the original homepage of SelfControl for Ubuntu (found thanks to the excellent OMG! Ubuntu page).
However, the package that can be found there is quite old, and has a very annoying bug when you run it on Ubuntu 12.10: You can't see the list of hosts that you are blocking. Other than that, it works as described.
Since this is open source software, I decided to try to fix things myself, to fail utterly due to my total lack of knowledge of Perl and GTK. But! GitHub to the rescue! I couldn't be the only one to notice this, right?
There were actually at least two possible sources: zengargoyle and serch.
I picked the later one, downloaded the file from his repository, replaced /usr/share/perl5/SelfControl/ with this updated version, and...


Now back to work! :)

Looks like more detailed instructions could be useful.

  1. Install the package found in the OMG Ubuntu article.
  2. Open a terminal by pressing Ctrl-Alt-T or looking for it in the Applications list.
  3. In the terminal, enter exactly this line (it's all one line):

    sudo wget -O /usr/share/perl5/SelfControl/
  4. You will need to enter your user password. This line will, in one go, download the "raw" code of and overwrite the original that came in the package. I shortened the link to try to get it as clear as possible. The actual link to the "raw" code of is this:
Let me know if you run into more issues!


  1. Hi there,
    I'm having problems deleting previous or double entries to the list of websites that I want to block for a couple of hours. When I start a new study session with SelfControl, I can't see or increase the list of hosts already present in the main window, there's no handle to re-size it. I've tried replacing the file (145kB) with the one in /usr/share/perl5/SelfControl/ but now something is wrong -- I click on the icon but the app won't start!

  2. I've done what you suggested but the application won't start if I click on it.
    What to do after I replace the file?

  3. The file is 13kB in size for me, not 145kB.
    Try using this link to download the one I used:

    I'll update the post to give more detailed steps.

    To find out if something went wrong, try opening a terminal (press Ctrl-Alt-T or look for Terminal in the Applications list).
    Then type:
    and press Enter.
    It should give you some error message if things don't work.

  4. Hi,
    I managed to solve that annoying problem by adding few lines in the original file (13kB) via gedit, in sudo mode, from Terminal. There's a thread in too:

  5. Hi, so glad to discover this!

    What do you think it would take to modify the way this works so that I can schedule daily self-control times (e.g. certain sites blocked 9am-5pm, or all sites blocked midnight to 6am) in advance? I'm happy to do things to config files in my system for now, and I could test out some things and let you know how it goes if you like, but right now I need a pointer about what I would have to start experimenting with, as I don't yet know how SelfControl does what it does. Thanks for any hints you have!

  6. FYI: you can only add more host to the block list when your computer connected to the Internet.


Post a Comment