AFKLocker 0.5.1
A hardening release. No new features — two display bugs that only showed up on a real machine, power settings that now apply all-or-nothing, and an uninstall that checks whether it worked.
The lid pause never actually ran
Opening the lid was supposed to leave the screen alone for ninety seconds, so it does not go dark again while you are still reaching for the keyboard. The decision was made, the policy was tested — and then thrown away. The lid handler passed its result to a method that only knew how to turn the display off or stop watching, so "wait, somebody is here" did nothing at all.
Two code paths for four outcomes, both of which compiled and both of which looked right. There is one path now, and a test that fails if an outcome is ever added without being handled.
Locking suppressed its own display-off
The most recent keyboard or mouse input at the moment you lock is the click or key that did the locking. Reading that as "somebody is at the machine" started a ninety-second pause against the very action that had just asked for the screen to go out.
Input now carries that meaning only once the screen has actually been dark — before then there was nothing for anyone to wake. Opening the lid still carries it immediately, because nobody opens a laptop by accident on their way out of the room.
Power settings apply all-or-nothing
A backup written before the first change makes recovery possible, and still leaves the machine half-configured with you unaware — which for these particular settings means a laptop that believes it will keep running with the lid shut and will actually sleep.
A write that fails unexpectedly now unwinds the writes that already landed, in reverse, and reports whether that unwinding was complete. The original error is carried rather than swallowed. The backup is never deleted on a failure. Access denied still surfaces as a prompt to run as administrator, because that is a recovery path rather than a defect.
Uninstalling checks whether its cleanup worked
Both the return value and the exit code were discarded, so an uninstall could report success while a startup entry survived — pointing into a folder about to be deleted, with no AFKLocker left to remove it. It now tells you, says where to look, and continues. The same applies to restoring your power settings: if that cannot be finished, it says where your original values are saved rather than letting you believe the machine was put back.
Documentation caught up with the code
The README still described a 45-second display guard that input or opening the lid would end, and said turning automatic mode off always leaves nothing resident — none of which had been true since 0.4.1 and 0.5.0. It now describes what the code does, including the part that is easy to get wrong: Windows ignores a display-off request while there has been recent input, which is why AFKLocker keeps asking rather than asking once.
Also
SECURITY.md— supported versions, how to report a vulnerability privately, and the properties a reviewer would otherwise have to establish from scratch: no network access, no telemetry, no keyboard hook, no service.- A version consistency check in both workflows. The version lives in three files; bumping two of three is an ordinary slip that produces an installer whose file name, Programs and Features entry and About text disagree. On a tag it checks the tag too.
- Tests for the display guard's timing, which was the one part of that class no test could reach because it read the clock directly.
Verifying this download
Still no code signing certificate — a recurring cost this project does not have — so SmartScreen will warn on first run. You do not have to take the download on trust:
gh attestation verify AFKLocker-0.5.1-setup.exe --repo augbastos/AFKLockerOr check the hash against SHA256SUMS.txt below.
Physically confirmed on one machine: screens dark on lock, lid closed, work continuing, and the screen left alone on reopening. Everything else is covered by tests against simulated machines — which is why AFKLocker Setup → Diagnostics → Export diagnostics exists: if it does not work on yours, you can say why in one file.