Skip to content

FanaHOVA/focus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Focus

A simple CLI tool to block distracting websites on macOS by modifying /etc/hosts.

Installation

make install

Or manually:

go build -o focus .
sudo mv focus /usr/local/bin/

Usage

# Block all configured sites
focus block

# Unblock all sites
focus unblock

# Check current status
focus status

# Open config file in editor
focus config

Configuration

Sites are stored in ~/.config/focus/sites.txt (one domain per line):

x.com
linkedin.com
discord.com
news.ycombinator.com

Edit this file to add or remove sites. Changes apply on next focus block.

How it works

  • Adds 127.0.0.1 <domain> entries to /etc/hosts
  • Flushes DNS cache after changes
  • Requires sudo to modify the hosts file

About

Block any website / app on MacOS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors