timeout

A simple command line tool to help you stay productive

Can't stay off twitter long enough to get stuff done? When you get bored of reddit do you go to reddit? Timeout might help. Sure, you could try using willpower, or manually block yourself using a host file, but both of those are annoying.

timeout makes blocking unproductive websites easy. It uses your hostfile to make them inaccessible but provides an easy way to unblock them when you want to.

Installation

You can download the latest version of timeout for mac or linux from here or if you're using a mac you can install it with homebrew:
$ brew update
$ brew install philwade/tools/timeout

Usage

Because of the nature of permissions on the hostfile, timeout requires you to run it with sudo. (Sorry!)

To get started you need to add some sites to block. We specify a name and domains to block:

$ sudo timeout add twitter twitter.com www.twitter.com
Added site twitter with urls twitter.com, www.twitter.com to blocking
$ sudo timeout add reddit reddit.com www.reddit.com
Added site reddit with urls reddit.com, www.reddit.com to blocking
If we want to turn off blocking, just tell timeout it's time "in":
$ sudo timeout in
Unblocked all sites
To turn it back on, just run timeout again:
$ sudo timeout
Blocked all sites
Turning off and on also works selectively, you just need to know the name of site(s):
$ sudo timeout in twitter
Unblocked sites: twitter
$ sudo timeout out twitter
Blocked sites: twitter
$ sudo timeout in twitter reddit
Blocked sites: twitter, reddit
For a reminder of how to use things just run:
$ timeout -h
or
$ timeout help

Other stuff

timeout is open source software. If you find a bug or want to request a feature head over to github and open an issue, or just read the code if you like.

For more about me, contact info and other projects, head over to philwade.org