Stay Focused Website Blocker is a CLI python program that can block distracting websites like Facebook, YouTube, Reddit etc during your work hours in order to keep you focused and boost your productivity.
- You need to have "Python 3" installed on your computer in order to use this script. No third party package is required.
- You need to have "Python 3" installed on your computer in order to use this script. No third party package is required.
To download the program simply click on the green Clone or Download button and Download ZIP. You may clone the repo if you want to.
After downloading the zip extract and there you have it
After extracting the zip you'll have following files in the directory
sfwb.py
is the main executable. website-list.txt
contains the list of websites to be blocked during working hours.
website-list.txt
file looks like this
You can write whatever address in here seperated by a comma(,). sfwb will read through this file on runtime to modify your hosts file.
Go to the directory where you have extracted the script and open a terminal/cmd instance in that directory. In case of Windows you must run CMS as administrator.
$ sudo python3 sfwb.py
C:\sfwb-folder\python sfwb.py
If this is the first time you are running sfwb, it'll ask for your working hour
Values are comma(,) separated here. So put your working hour start time and end time as StartTime,EndTime. In my country wroking hour is from 8am to 6pm so I'll input 8,16. Input has to be given in 24 hours format. This will be asked only the first time. The timetable will be saved in a file in your home directory.
$ sudo python3 sfwb.py reset
C:\sfwb-folder\python sfwb.py reset
$ sudo python3 sfwb.py erase
C:\sfwb-folder\python sfwb.py erase
This command will restore your original hosts file and remove all traces of this program.
Feedback: [email protected]