Skip to content

Commit f7a8612

Browse files
committed
Initial commit
0 parents  commit f7a8612

16 files changed

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