Skip to content

👌 Do not get distracted with social media by blockading them via /etc/hosts

License

Notifications You must be signed in to change notification settings

papachristoumarios/dnd.py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dnd.py

Do not disturb yourself again by social media and other distracting websites.

This self-explanatory command line tool aims to put all of these websites in a corner in order to work without distractions!

It works by simply putting all these websites to /etc/hosts and redirecting them to 127.0.0.1.

Authors

  • Marios Papachristou

We accept contributions to the project under the form of pull requests.

Setup

In order to setup the script use the setup.py file provided by the project

python setup.py install

Usage

In order to block the distracting websites type in (with sudo)

sudo dnd.py -e 

You can also specify a time interval that the blockade is activated via

sudo dnd.py -e -t 1 # Interval Specified in Minutes

After one minute, you can get distracted again!

There is also an option to activate the blockade until a specific time in the future via

sudo dnd.py -e -u 16:00 # Time Format HH:MM

To remove the blockade use the -d flag

sudo dnd.py -d	

In case you want to experiment further, please backup /etc/hosts via

sudo dnd.py -b

And restore it anytime you want with

sudo dnd.py -r

Customization

In order to customize dnd.py for your needs you can change the following variables in dnd.py

''' Here you put the distractive websites '''
distractions = [
    'a website',
    'another website'
]

''' Here you put the redirection url '''
redirect = '127.0.0.1'

License

This tool is licensed under the MIT License.

About

👌 Do not get distracted with social media by blockading them via /etc/hosts

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages