ejmg / tomaty

tomaty is a gtk+3 based application for the pomodoro technique 🍅
MIT License
6 stars 1 forks source link

setting: block distractions via system Hosts file. #46

Open ejmg opened 6 years ago

ejmg commented 6 years ago

This is a big stretch goal. Implement a way to consistently and (somewhat) safely to manipulate a user's hosts file a la /etc/hosts for linux. Here's how I do it on ubuntu for example:

/etc/hosts:

127.0.0.1 localhost
127.0.0.1 blackbox
0.0.0.1     twitter.com

# IPv6
::1 twitter.com

This is clearly an issue that would vary, at least somewhat, between n*x and Windows. It is also a feature that would involve DNS caching one way or another. For instance, chromium keeps its own cache separate to that of the OS. Until that updates, a user is able to access a website that was recently blocked in their respective hosts file. Figuring out a way to:

or a combination of the above would probably be necessary to make the feature consistent/effective.

This is also a feature that should be flagged as having a fringe possibility of messing the user's networking up. It has never given me a serious problem, but possibly combined with another program manipulating DNS/hosts, I see the possibility.

ejmg commented 6 years ago

See also SelfControl and its (defunct) port for linux.

I just want something simple but somewhat functional. It does not need to be advanced and I will not delude myself into thinking I can create a feature that can circumvent a dedicated procrastinator.