Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lockin-0.5.0.tar.gz (69.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lockin-0.5.0-py3-none-any.whl (43.4 kB view details)

Uploaded Python 3

File details

Details for the file lockin-0.5.0.tar.gz.

File metadata

  • Download URL: lockin-0.5.0.tar.gz
  • Upload date:
  • Size: 69.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for lockin-0.5.0.tar.gz
Algorithm Hash digest
SHA256 60c9b6aca50a29043bd0960690b4e290b1d53c9f774dda81466433d0e239a9a9
MD5 481eaca3bb4603caf2a6997e3d8f8f66
BLAKE2b-256 57ca3a2361709aa34d1e180eb18517a101e9fbd58f9456a4319cf716ebb05219

See more details on using hashes here.

File details

Details for the file lockin-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: lockin-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 43.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for lockin-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9bfcc33485f89bf6e7f478a90b6a30ed5b3abb65f0cb9e32e98a3b81aa69de3c
MD5 4199173b9499a70b2d55deea0e25e93d
BLAKE2b-256 a865b4991f9c430a5af6f3f88d7073cfe4d666ca2c16cb1a936f891b38ad85b4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page