Tool that allows you to lock-in! Focus on your projects and work without doomscrolling and brainrot to distract and procrastinate your work!
Lock In is a desktop application designed to help you maintain deep focus by blocking all applications except those you whitelist. When you start a focus session, the app goes fullscreen, closes all non-whitelisted apps, and prevents them from being reopened until your session ends.
- Focus Sessions: Set a duration and list of allowed apps for distraction-free work
- App Blocking: Automatically closes and prevents non-whitelisted apps from running
- Real-time Monitoring: Continuously monitors and blocks attempts to open distracting apps
- Session Tracking: Stores all session data including duration, apps blocked, and completion rate
- Statistics Dashboard: View your productivity trends, total focus time, and most blocked apps
- Emergency Exit: Safe way to exit a session early if needed
- Modern UI: Clean, dark-themed interface with real-time updates
- Language: Python 3.11+
- GUI Framework: PyQt6
- Process Management: psutil
- Database: SQLite
LockIN/
├── main.py # Application entry point
├── requirements.txt # Python dependencies
├── ui/ # UI components
│ ├── main_window.py # Main window with all screens
│ └── widgets.py # Custom reusable widgets
├── core/ # Business logic
│ ├── app_blocker.py # Process management & blocking
│ ├── session_manager.py # Session coordination
│ └── stats_tracker.py # Statistics & analytics
├── database/ # Database layer
│ ├── db_manager.py # SQLite operations
│ └── schema.sql # Database schema
└── assets/ # Icons and images
- Python 3.11 or higher
- pip (Python package manager)
- Administrative/root privileges (required to manage other applications)
-
Clone the repository:
git clone https://github.com/yourusername/LockIN.git cd LockIN -
Create a virtual environment (recommended):
python -m venv venv # On Windows: venv\Scripts\activate # On Linux/macOS: source venv/bin/activate
-
Install dependencies:
pip install -r requirements.txt
On Windows (Run as Administrator):
# Right-click on Command Prompt and select "Run as Administrator"
python main.pyOn Linux/macOS (Run with sudo):
sudo python main.pyNote: Administrative privileges are required to manage and close other applications.
-
Session Setup Screen:
- Enter a session name (e.g., "Deep Work", "Study Time")
- Set duration using the hours and minutes picker
- Select apps to whitelist from the running apps list
- Click "Add to Whitelist" to allow specific apps
- Click "Start Session" when ready
-
During Session:
- The timer counts down your remaining time
- All non-whitelisted apps are closed and blocked
- Progress bar shows session completion
- Stats update in real-time (time elapsed, apps blocked)
- Emergency Exit button available if needed
-
Session End:
- View session statistics and completion rate
- See comparison with previous sessions
- Start a new session or view overall statistics
Common apps you might want to whitelist:
- Code editors (VS Code, PyCharm, Sublime Text)
- Browsers (for documentation/research)
- Development tools (Terminal, Git clients)
- Communication apps (Slack, Discord - if needed for work)
- Note-taking apps (Notion, Obsidian, OneNote)
Tip: Start with minimal whitelisted apps for maximum focus!
- Initial Scan: On session start, scans all running processes
- Whitelist Check: Identifies whitelisted apps vs. apps to block
- Immediate Closure: Closes all non-whitelisted applications
- Continuous Monitoring: Every second, checks for new processes
- Auto-Block: Automatically terminates any non-whitelisted app that starts
- Safe Guards: Never blocks critical system processes
- sessions: Stores session metadata, duration, completion status
- blocked_apps: Tracks which apps were blocked during each session
- settings: User preferences and configuration
- Critical system processes are never terminated
- Emergency exit available at any time
- Session data is saved even if app crashes
- Graceful termination of blocked processes
- UI Layer (
ui/): PyQt6 widgets and screens - Core Logic (
core/): Session management, app blocking, statistics - Data Layer (
database/): SQLite database operations
SessionManager: Orchestrates focus sessions, timing, and stateAppBlocker: Handles process detection and terminationDatabaseManager: Manages all database operationsStatsTracker: Provides analytics and statistics
- New UI Screen: Add to
ui/main_window.pyand connect to stack widget - Core Logic: Extend classes in
core/directory - Database Changes: Update
schema.sqlanddb_manager.py
- Solution: Make sure you're running with administrative/root privileges
- On Windows: Right-click and "Run as Administrator"
- On Linux/macOS: Use
sudo python main.py
- Solution: Delete the database file at
~/.lockin/lockin.dbto reset - Note: This will delete all session history
- Check if session is active (app blocks closing during active sessions)
- Use Emergency Exit to end session first
- Some apps have auto-restart mechanisms
- The blocker will continue blocking them as they restart
Future features planned:
- Statistics dashboard screen with charts
- Customizable motivational quotes
- Scheduled sessions (auto-start at specific times)
- Break reminders and Pomodoro mode
- Website blocking (browser extension)
- macOS and Linux full support
- Portable executable builds
- Cloud sync for statistics
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License - See LICENSE file for details
This application terminates running processes. Use responsibly and save your work before starting a session. The developers are not responsible for any data loss.
For issues, questions, or suggestions, please open an issue on GitHub.
Stay focused. Lock in. Level up. 🚀