Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

ADHD Focus

A lightweight, native macOS menu bar app that blocks distractions for ADHD brains — hard enough that you can't casually route around it, light enough that it stays out of your way.

Built in Swift/AppKit with no dependencies. The app lives in your menu bar; start a focus session and distracting sites, URLs, and apps are blocked until you stop.

Install

Download the latest release — no build tools needed:

  1. Grab ADHD-Focus-v0.1.0.zip from Releases.
  2. Unzip and drag ADHD Focus.app into /Applications.
  3. First launch: right-click the app → Open → Open. (The app is not notarized, so macOS Gatekeeper warns on a normal double-click.)

Works on both Apple Silicon and Intel Macs (universal binary). Requires macOS 13 (Ventura) or later.

Starting a focus session prompts for an administrator password — that's the app editing /etc/hosts (see below).

How it blocks

Three layers, each catching what the previous one can't:

Layer Config key Mechanism
Hard domain blocks hardBlockedDomains Writes a marked section into /etc/hosts pointing domains at 0.0.0.0. Blocks every browser and app system-wide.
Smart URL rules smartBlockedURLs Path-level rules (e.g. block youtube.com/shorts/* but not the rest of YouTube) enforced by polling supported browsers via AppleScript and redirecting blocked tabs to a local block page.
App blocks blockedAppBundleIDs Quits any running app whose bundle ID is listed (e.g. com.tinyspeck.slackmacgap for Slack), checked every second while focus is on.

Only the section between these markers in /etc/hosts is ever touched:

# >>> ADHD Focus block
# <<< ADHD Focus block

Smart URL rules work in Safari, Safari Technology Preview, Chrome (incl. Beta/Canary), Brave, Arc, and Opera. Firefox gets hard domain blocks only.

Configure

Choose Open Config from the menu bar app, or edit the JSON directly at:

~/Library/Application Support/ADHD Focus/config.json

The default config:

{
  "blockedAppBundleIDs" : [],
  "browserPollIntervalSeconds" : 1,
  "hardBlockedDomains" : [
    "facebook.com",
    "instagram.com",
    "reddit.com",
    "tiktok.com",
    "twitter.com",
    "x.com",
    "youtube.com"
  ],
  "smartBlockedURLs" : [
    "youtube.com/shorts/*",
    "reddit.com/r/all/*",
    "reddit.com/r/popular/*"
  ]
}

To find an app's bundle ID for blockedAppBundleIDs:

osascript -e 'id of app "Slack"'

Config changes are read when a focus session starts, so restart the session after editing.

Build from source

Requires Xcode Command Line Tools with Swift 5.9+.

cd ADHDFocus
./Scripts/build-app.sh

This produces a universal (arm64 + x86_64), ad-hoc-signed bundle at ADHDFocus/dist/ADHD Focus.app.

Run the core tests:

cd ADHDFocus
swift run ADHDFocusCoreTests

More detail in ADHDFocus/README.md.

Known limitations

  • Unsigned/not notarized — macOS asks for approval on first open.
  • Hard blocks are domain-level only; /etc/hosts can't see URL paths.
  • Smart URL rules need macOS Automation permission for each browser (you'll be prompted).
  • Start/stop uses an admin password prompt each time rather than an installed privileged helper.

About

a mac Focus tool for ADHD brain

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages