CLI focus blocker for macOS — block distracting websites and apps
Project description
Lockin
Focus blocker for macOS. Blocks distracting websites and apps so you can get work done.
lockin
╭──────────────────────────────────────╮
│ LOCKIN v0.3.0 │
│ Focus when it matters most │
╰──────────────────────────────────────╯
Main Menu
[1] Start a Focus Session
[2] Manage Profiles
[3] Manage Schedules
[4] Always-Blocked Sites
[5] View Presets
[6] Activity Recap
[7] Settings & Info
[0] Exit
How it works
- Blocks websites via
/etc/hosts— works across every browser, no extensions - Kills distracting apps on launch (Discord, Spotify, etc.)
- Sessions are tamper-resistant — once started, they can't be stopped
- A launchd watchdog re-applies blocks every 3 seconds, survives reboots
- Tracks your activity in the background — apps, browser URLs, productivity score
- Menu bar app shows live session countdown and runs the activity tracker
- Periodic screenshot capture (opt-in) for visual activity logging
Install
Requires macOS and Python 3.11+.
pipx install lockin
Setup
# Launch the interactive menu
lockin
# Or use CLI shortcuts
lockin --status # Check active session
lockin --recap # Today's productivity report
lockin --recap weekly # Weekly summary
The interactive menu walks you through everything — creating profiles, starting sessions, configuring settings.
Key concepts
Presets are built-in bundles of sites/apps by category (social, entertainment, news, gaming, communication).
Profiles combine presets with custom sites and apps into a blocking configuration.
Sessions activate a profile for a set duration. Once started, there's no stopping it.
Presets Profile Session
───────── ──────── ────────
social ─┐ "work" 2h focus
entertainment ┼──> + slack.com ────> 96 domains blocked
news ─┘ + Slack app 3 apps killed
Activity tracking
The menu bar app (lockin-menubar) tracks your activity in the background:
- Detects frontmost app and window title every second
- Extracts browser URLs via the Accessibility API
- Categorizes activity as productive / neutral / distracting
- Stores everything in a local SQLite database
- Optional periodic screenshots saved as compressed JPEGs
View your data anytime with lockin --recap or through the interactive menu.
Tamper protection
| Attack | Mitigation |
|---|---|
Edit /etc/hosts |
Immutable flag; watchdog re-applies |
| Kill the watchdog | launchd auto-respawns it |
| Delete session file | Blocks become permanent |
| Modify session times | HMAC signature invalidates |
| Reboot | Session persists, daemon has RunAtLoad |
Storage
- Config:
~/.config/lockin/config.json - Activity DB:
~/.config/lockin/activity.db - Screenshots:
~/.config/lockin/screenshots/ - Sessions:
/var/lockin/session.json
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lockin-0.4.0.tar.gz.
File metadata
- Download URL: lockin-0.4.0.tar.gz
- Upload date:
- Size: 66.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9e84eaea0aa829df625855aefa5896e6fc5de4b0f053a465b4013740baf4a884
|
|
| MD5 |
92d4e5dd0f51417b1ddd623245814884
|
|
| BLAKE2b-256 |
e03c28aa3ff188f7e7e0af08b5d01c0d7b25a99f3d987ef3f47b9e50b028ac23
|
File details
Details for the file lockin-0.4.0-py3-none-any.whl.
File metadata
- Download URL: lockin-0.4.0-py3-none-any.whl
- Upload date:
- Size: 40.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0e763decc7c1751d6b767f0d278c6475714bb1d489b3d3388aa2f9f3f102aeba
|
|
| MD5 |
81c34797a6b6c7b3d58b6146100cd3b4
|
|
| BLAKE2b-256 |
54a36253456d78b5486c9b1a23be6c6f009a036b6878abd1bc2e5fa7423ca40b
|