|
| 1 | +# Turn Off Screen on Lock |
| 2 | + |
| 3 | +**Lock your PC and the screen goes dark in 5 seconds. Wake it up and you have all the time you need to unlock.** |
| 4 | + |
| 5 | +No more choosing between a fast screen-off and actually being able to sign back in. |
| 6 | + |
| 7 | + |
| 8 | +## The problem |
| 9 | + |
| 10 | +Windows has one setting for how long the display stays on at the lock screen. Set it short and the screen goes dark fast after locking -- but it also goes dark while you're trying to type your password. Set it long and you're staring at the lock screen waiting for it to turn off. |
| 11 | + |
| 12 | +There's no built-in way to have both. |
| 13 | + |
| 14 | + |
| 15 | +## The fix |
| 16 | + |
| 17 | +This tool automatically adjusts the timeout through each lock/unlock cycle: |
| 18 | + |
| 19 | +| Moment | What happens | |
| 20 | +|---|---| |
| 21 | +| You lock the PC | Screen turns off in **5 seconds**, if no activity is detected | |
| 22 | +| You wake it to unlock | Screen stays on for **5 minutes**, if no activity is detected | |
| 23 | +| You unlock | Resets to **5 seconds** for the next cycle | |
| 24 | + |
| 25 | +Both timeout values are [configurable](#configuration). |
| 26 | + |
| 27 | +No manual toggling. No remembering to change settings. It just works, every single time. |
| 28 | + |
| 29 | + |
| 30 | +## Installation |
| 31 | + |
| 32 | +1. Open PowerShell as Administrator |
| 33 | +2. Navigate to the folder where you want to install (the files will stay here permanently): |
| 34 | + |
| 35 | +```powershell |
| 36 | +cd <your-folder> |
| 37 | +``` |
| 38 | + |
| 39 | +3. Download and install the latest release: |
| 40 | + |
| 41 | +```powershell |
| 42 | +irm https://github.com/michaliskon/Turn-off-screen-on-lock/releases/latest/download/install.ps1 | iex |
| 43 | +``` |
| 44 | + |
| 45 | +The bootstrap script automatically verifies the download checksum before running. |
| 46 | + |
| 47 | +<details> |
| 48 | +<summary>Manual installation (inspect before running)</summary> |
| 49 | + |
| 50 | +If you prefer to review the bootstrap script before execution: |
| 51 | + |
| 52 | +```powershell |
| 53 | +Invoke-WebRequest https://github.com/michaliskon/Turn-off-screen-on-lock/releases/latest/download/install.ps1 -OutFile install.ps1 |
| 54 | +Get-Content install.ps1 |
| 55 | +``` |
| 56 | +Then: |
| 57 | +``` |
| 58 | +.\install.ps1 |
| 59 | +``` |
| 60 | + |
| 61 | +</details> |
| 62 | + |
| 63 | +## Environment |
| 64 | + |
| 65 | +- Windows 10 or 11 with Modern Standby (S0 Low Power Idle) |
| 66 | +- PowerShell 5.1+ |
| 67 | +- Administrator privileges (one-time, for installation) |
| 68 | + |
| 69 | + |
| 70 | +## Configuration |
| 71 | + |
| 72 | +The timeout values are set by default to: |
| 73 | +- **5 seconds** on lock |
| 74 | +- **5 minutes** on wake |
| 75 | + |
| 76 | +And can be modified by editing the config file: |
| 77 | + |
| 78 | +``` |
| 79 | +%LOCALAPPDATA%\Turn-off-screen-on-lock\config.json |
| 80 | +``` |
| 81 | + |
| 82 | +Default contents: |
| 83 | + |
| 84 | +```json |
| 85 | +{ |
| 86 | + "baselineTimeoutSeconds": 5, |
| 87 | + "wakeTimeoutSeconds": 300 |
| 88 | +} |
| 89 | +``` |
| 90 | + |
| 91 | +| Setting | Default | Description | |
| 92 | +|---|---|---| |
| 93 | +| `baselineTimeoutSeconds` | 5 | Seconds before the screen turns off after locking | |
| 94 | +| `wakeTimeoutSeconds` | 300 | Seconds the screen stays on when waking to unlock | |
| 95 | + |
| 96 | +Both values must be integers between 1 and 86400 (24 hours). |
| 97 | + |
| 98 | +The config file is created automatically during installation. Changes take effect on the next lock, unlock, or wake event -- no reinstall needed. |
| 99 | + |
| 100 | + |
| 101 | +## Uninstallation |
| 102 | +In case you want to uninstall: |
| 103 | + |
| 104 | +1. Open PowerShell as Administrator |
| 105 | +2. Run: |
| 106 | + |
| 107 | +```powershell |
| 108 | +& "$env:TURN_OFF_SCREEN_ON_LOCK_UNINSTALL" |
| 109 | +``` |
| 110 | + |
| 111 | +3. Once the uninstaller confirms success, you can delete the install folder. |
| 112 | + |
| 113 | + |
| 114 | +## Security Review |
| 115 | + |
| 116 | +The security and reliability profiles chosen for this project are targeting personal use on trusted home machines. |
| 117 | + |
| 118 | +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](threat-model-v1.0.0.md) for the related risks. |
| 119 | + |
| 120 | + |
| 121 | +## Documentation |
| 122 | + |
| 123 | +See [spec.md](spec.md) for the full design specification. |
| 124 | + |
| 125 | + |
| 126 | +## Human / AI 🤖 Contribution in this Project |
| 127 | + |
| 128 | +Based on the project complexity and criticality, human oversight was kept to *low/medium* effort. |
| 129 | +||| |
| 130 | +|:---|:---:| |
| 131 | +| Complexity | Low | |
| 132 | +| Criticality | Low | |
| 133 | +||| |
| 134 | + |
| 135 | + |
| 136 | +### Activity split |
| 137 | + |
| 138 | +| Activity | Human | AI | |
| 139 | +|:---|:---:|:---:| |
| 140 | +| Use case development | ✔️ | ❌ | |
| 141 | +| Design | ❌ | ✔️ | |
| 142 | +| Design review | ✔️ | ❌ | |
| 143 | +| Coding | ❌ | ✔️ | |
| 144 | +| Code review | ❌ | ✔️ | |
| 145 | +| Functional testing | ✔️ | ❌ | |
| 146 | +| Security analysis | ❌ | ✔️ | |
| 147 | +| Security risk review | ✔️ | ❌ | |
| 148 | +| Security risk remediation | ❌ | ✔️ | |
| 149 | +| Deployment | ✔️ | ✔️ | |
| 150 | + |
| 151 | +### LLMs used |
| 152 | +| Phase | LLM/coding assistant | |
| 153 | +|---|---| |
| 154 | +| PoC and initial development | ChatGPT | |
| 155 | +| Maturing and release | Claude Code | |
| 156 | +| Continuous security reviews and hardening | Claude Code | |
| 157 | +| Final security reviews (release) | Claude Code, Codex, Gemini | |
| 158 | + |
| 159 | + |
| 160 | + |
| 161 | +## Contributing |
| 162 | + |
| 163 | +### Bugs |
| 164 | +Bug reports are welcome - please open an [issue](https://github.com/michaliskon/Turn-off-screen-on-lock/issues) first using the "Bug report" template. |
| 165 | +No unsolicited PRs. |
| 166 | + |
| 167 | +### Security Vulnerabilities |
| 168 | +Report security vulnerabilities in [GitHub Security Advisories](https://github.com/michaliskon/Turn-off-screen-on-lock/security/advisories/new) - see also [SECURITY.md](SECURITY.md) |
| 169 | +- Security hardening for home use will be supported, provided the vulnerability can be demonstrated sufficiently. |
| 170 | +- Security hardening relevant only for enterprise use will be supported, if there is enough community interest. |
| 171 | +- Critical or high criticality vulnerabilities will always be investigated and responded to (and if possible remediated), regardless of usage or interest. |
| 172 | + |
| 173 | +### Features |
| 174 | +All feature requests are welcome - please open an [issue](https://github.com/michaliskon/Turn-off-screen-on-lock/issues) using the "Feature request" template. |
| 175 | +- Feature requests for home use will be supported, considering a real use case can be exhibited. |
| 176 | +- Feature requests for enterprise use will be supported, if there is enough community interest. |
| 177 | + |
| 178 | + |
| 179 | + |
| 180 | +## License |
| 181 | + |
| 182 | +[MIT](LICENSE) |
0 commit comments