Skip to content

Commit a4d1b8c

Browse files
committed
Initial commit
0 parents  commit a4d1b8c

16 files changed

Lines changed: 2448 additions & 0 deletions

.gitattributes

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Exclude development/documentation files from archive downloads
2+
.gitignore export-ignore
3+
.gitattributes export-ignore
4+
spec.md export-ignore
5+
threat-model.md export-ignore
6+
CHANGELOG.md export-ignore
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Screenshots**
24+
If applicable, add screenshots to help explain your problem.
25+
26+
**Desktop (please complete the following information):**
27+
- OS: [e.g. iOS]
28+
- Browser [e.g. chrome, safari]
29+
- Version [e.g. 22]
30+
31+
**Smartphone (please complete the following information):**
32+
- Device: [e.g. iPhone6]
33+
- OS: [e.g. iOS8.1]
34+
- Browser [e.g. stock browser, safari]
35+
- Version [e.g. 22]
36+
37+
**Additional context**
38+
Add any other context about the problem here.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

.github/workflows/release.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Create Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Verify tag is on main
21+
run: |
22+
if ! git branch -r --contains "${{ github.sha }}" | grep -qE 'origin/main$'; then
23+
echo "::error::Release tags must point to a commit on the main branch."
24+
exit 1
25+
fi
26+
27+
- name: Create release zip
28+
run: |
29+
mkdir release
30+
cp src/installer.ps1 release/
31+
cp src/uninstaller.ps1 release/
32+
cp src/LockTimeoutController.ps1 release/
33+
cp src/RunHidden.vbs release/
34+
cp README.md release/
35+
cp LICENSE release/
36+
cd release
37+
zip -r ../Turn-off-screen-on-lock-${{ github.ref_name }}.zip .
38+
39+
- name: Generate checksums
40+
run: sha256sum Turn-off-screen-on-lock-${{ github.ref_name }}.zip src/install.ps1 > checksums-sha256.txt
41+
42+
- name: Create GitHub Release
43+
uses: softprops/action-gh-release@153bb8e04406b158c6c84fc1615b65b24149a1fe # v2.6.1
44+
with:
45+
files: |
46+
Turn-off-screen-on-lock-${{ github.ref_name }}.zip
47+
checksums-sha256.txt
48+
src/install.ps1
49+
generate_release_notes: true

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
state.json
2+
settings.json
3+
.claude/

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
| Version | Date | Changes |
6+
|:---------:|:------:|:---------|
7+
| 1.0.0 | 04-Apr-2026 | Initial release |

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 michaliskon
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
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)

SECURITY.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Security Policy
2+
3+
## Supported Versions
4+
5+
| Version | Supported | Security Acceptance |
6+
| :-------: | :----------------: | :------------: |
7+
| 1.0.0 (current) || [threat-model-v1.0.0.md](threat-model-v1.0.0.md) |
8+
| | | |
9+
10+
11+
If you discover a security vulnerability, please check the latest security review, which is listed above. In case the vulnerability you have identified is not listed there or you think it is not covered thoroughly or has been misclassified, please report it privately via
12+
[GitHub Security Advisories](https://github.com/michaliskon/Turn-off-screen-on-lock/security/advisories/new).
13+
14+
Do **not** open a public issue for security vulnerabilities.
15+
16+
*I will acknowledge receipt within 72 hours and aim to provide a fix or mitigation plan within 7 days for confirmed issues.*

0 commit comments

Comments
 (0)