Lock your PC, screen goes dark in 5 seconds. Come back, and you actually have time to type your password.
Let's say that you want your screen to go dark 5 seconds after Windows is locked.
There is only one setting (VIDEOCONLOCK) that controls this on both occasions:
- After you lock: you want it short, like 5 seconds, so the screen goes dark quickly
- When you want to unlock: that same 5 seconds is all you get to start typing your password before the screen goes dark again
This can especially useful, if you are using a docking station, which often takes several seconds (up to 10-15) for the whole system to "wake up".
Flips VIDEOCONLOCK between a short and long value at the right time:
| When | Timeout |
|---|---|
| You lock the PC | 5 seconds (screen off fast) |
| You wake it to unlock | changed to 5 minutes (enough time to start typing your password) |
| You unlock | Back to 5 seconds for next time |
Both values are configurable.
Under the hood it's three scheduled tasks and a PowerShell script that rewrite the setting on lock, wake, and unlock events. Nothing stays running in the background.
- Windows 10 or 11 with Modern Standby (S0 Low Power Idle)
- PowerShell 5.1+
- Admin privileges (one-time, for install)
- Open PowerShell as Admin
cdto where you want the files to live (they stay there):
cd <your-folder>- Download and install the latest release:
irm https://github.com/michaliskon/Turn-off-screen-on-lock/releases/latest/download/install.ps1 | iexThe script verifies the download checksum before running.
Manual installation (inspect before running)
If you prefer to review the bootstrap script before execution:
Invoke-WebRequest https://github.com/michaliskon/Turn-off-screen-on-lock/releases/latest/download/install.ps1 -OutFile install.ps1
Get-Content install.ps1Then:
.\install.ps1
Defaults:
- 5 seconds after lock
- 5 minutes on wake
Can be adjusted by editing the config file:
%LOCALAPPDATA%\Turn-off-screen-on-lock\config.json
{
"baselineTimeoutSeconds": 1,
"wakeTimeoutSeconds": 300
}| Setting | Default | Description |
|---|---|---|
baselineTimeoutSeconds |
1 | Seconds before the screen turns off after locking |
wakeTimeoutSeconds |
300 | Seconds the screen stays on when waking to unlock |
Both values must be integers between 1 and 86400 (24 hours).
The config file is created automatically during installation. Changes take effect on the next lock, unlock, or wake event -- no reinstall needed.
In case you want to uninstall:
- Open PowerShell as Administrator
- Run:
& "$env:TURN_OFF_SCREEN_ON_LOCK_UNINSTALL"- Once the uninstaller confirms success, you can delete the install folder.
The security and reliability profiles chosen for this project are targeting personal use on trusted home machines.
Enterprise and public device usage have been included in the security review, which concluded that additional hardening is strongly recommended in such cases - see threat-model-v1.0.0.md for the related risks.
See spec.md for the full design specification.
Based on the project complexity and criticality, human oversight was kept to low/medium effort.
| Complexity | Low |
| Criticality | Low |
| Activity | Human | AI |
|---|---|---|
| Use case development | ✔️ | ❌ |
| Design | ❌ | ✔️ |
| Design review | ✔️ | ❌ |
| Coding | ❌ | ✔️ |
| Code review | ❌ | ✔️ |
| Functional testing | ✔️ | ❌ |
| Security analysis | ❌ | ✔️ |
| Security risk review | ✔️ | ❌ |
| Security risk remediation | ❌ | ✔️ |
| Deployment | ✔️ | ✔️ |
| Phase | LLM/coding assistant |
|---|---|
| PoC and initial development | ChatGPT |
| Maturing and release | Claude Code |
| Continuous security reviews and hardening | Claude Code |
| Final security reviews (release) | Claude Code, Codex, Gemini |
Bug reports are welcome - please open an issue first using the "Bug report" template. No unsolicited PRs.
Report security vulnerabilities in GitHub Security Advisories - see also SECURITY.md
- Security hardening for home use will be supported, provided the vulnerability can be demonstrated sufficiently.
- Security hardening relevant only for enterprise use will be supported, if there is enough community interest.
- Critical or high criticality vulnerabilities will always be investigated and responded to (and if possible remediated), regardless of usage or interest.
All feature requests are welcome - please open an issue using the "Feature request" template.
- Feature requests for home use will be supported, considering a real use case can be exhibited.
- Feature requests for enterprise use will be supported, if there is enough community interest.