Skip to content

⚑ Don't Lock My PC

Keep your computer awake and unlocked while long-running AI agents do the work β€” then let it sleep normally when you're done.

β€œWhile AI agents are working, your system should never lock or sleep.”

CI status Latest release Downloads Python 3.9+ Platform License

Don't Lock My PC β€” app window


Why this exists

AI agents and automated workflows often run for minutes or hours. If you walk away, corporate or personal lock-and-sleep policies kick in β€” locking the screen, sleeping the machine, or turning off the display. That can pause the agent, drop an RDP session, or interrupt the task entirely.

Start Don't Lock My PC before a long run and it keeps everything awake until you click STOP β€” no registry hacks, no policy changes you can't undo.

πŸ€– Built for agent runs

Start it before a lengthy agent or automation task so the session never locks or sleeps mid-run.

πŸ–₯️ Cross-platform

One codebase, one identical UI on Windows and macOS, with OS-native mechanisms behind a small backend abstraction.

πŸ’€ Lid-close stay-awake

On Windows, optionally keep working with the laptop lid shut β€” your original power setting is restored on STOP.

⏻ Scheduled power action

Sleep, Hibernate, or Shut down after a timer β€” β€œkeep my PC awake for the agent, then power it off when done.”

πŸ«₯ Zero footprint

An invisible F15 keypress and Β±1px mouse nudges. No clicking, no typing, no interference with your work.

πŸš€ Start at login

Optional autostart via the Windows Run key or a macOS LaunchAgent, so it's ready before your next run.


Quick start

  1. Download the archive for your OS from the buttons above or the latest release.
  2. Unzip it.
  3. Run DontLockMyPC.exe (Windows) or DontLockMyPC.app (macOS).
git clone https://github.com/mahanteshimath/do-not-lock-my-system.git
cd do-not-lock-my-system
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install .
python -m dontlockpc
git clone https://github.com/mahanteshimath/do-not-lock-my-system.git
cd do-not-lock-my-system
python3 -m venv .venv
source .venv/bin/activate
pip install .
python -m dontlockpc

Then press START, and the machine stays awake until you press STOP.

Full installation guide How it works


How it keeps you awake

Platform Prevent sleep / display off Reset lock / inactivity timer
Windows SetThreadExecutionState (ES_SYSTEM_REQUIRED | ES_DISPLAY_REQUIRED) SendInput mouse Β±1px + invisible F15 keypress
macOS built-in caffeinate -dimsu subprocess Quartz CGEvent mouse Β±1px + invisible F15 keypress

Why both mechanisms?

On Windows, SetThreadExecutionState prevents sleep but does not reset the screen-lock timer β€” which is why the mouse + F15 nudge is also needed. On macOS, caffeinate handles sleep while the Quartz events keep the session active.


Developed with ❀️ by MAHANTESH HIREMATH