Files
Asger Geel WeirsøeandClaude Opus 5.5 e58a11c2b4 feat: flyt sitet fra Astro til Zola
Samme indhold, URL'er og udseende, bygget af en enkelt zola-binær og Tailwind
standalone-CLI uden Node. Kanonisk domæne er asger.weirsoe.dk.

Blogindlæg ligger som page bundles med frontmatter Zola forstår, så de gamle
stempler er ugyldige, indtil scripts/omstempl.py er kørt med PUBLISH_KEY.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 16:47:08 +01:00

2.9 KiB

title, description, date, updated, extra
title description date updated extra
ahfail A screen locker for Linux and macOS. Type the wrong password and Dennis Nedry shows up to tell you "ah ah ah, you didn't say the magic word". 2026-09-30 2026-09-30
lang repo sprog licens platforme aur tags alternates
en gtk-ahfail Rust AGPL-3.0-only
Linux (Wayland)
Linux (X11)
macOS
ahfail
ahfail-bin
linux
wayland
x11
macos
pam
rust
lang path
da /projekter/ahfail
lang path
en /en/projects/ahfail

Get the password wrong and a looping animation of my own face photoshopped onto Dennis Nedry from Jurassic Park appears, while the "ah ah ah, you didn't say the magic word" clip plays. The volume goes all the way up, so whoever tried to sneak into your machine gets the full experience (--no-max-volume if you'd rather be discreet). Under the joke it's a real screen locker.

ahfail          # lock the screen
ahfail test     # see the effect without locking
ahfail doctor   # what is this machine missing?

It's one program on Linux, and it works out by itself whether you run Wayland or X11. On Wayland it locks through ext-session-lock-v1, so it works in sway, Hyprland, niri, river, labwc and KDE Plasma 6. GNOME doesn't let other programs lock the screen, so it's out there. On X11 it does what i3lock does: full-screen windows on every monitor and a grab on keyboard and pointer, and if it can't get the grab it refuses to lock rather than show a lock screen your keystrokes go straight through.

The password is checked through its own PAM service, /etc/pam.d/ahfail, which the package installs. It doesn't touch any other package's PAM configuration, the same way swaylock and gtklock don't. It includes login, so the system's pam_faillock policy applies, and on Arch that means three wrong passwords within fifteen minutes lock the account for ten. Worth knowing before you show it off on a Friday afternoon.

A screen locker sits right in the authentication path, so a bug in it could weaken the lock in the worst case. There are no guarantees, and you install it at your own risk. The package says so too.

Install

On Arch Linux, from source or prebuilt:

yay -S ahfail
yay -S ahfail-bin

Run ahfail doctor afterwards. It tells you whether the session type is supported, whether the PAM file is in place, whether GStreamer can play the clip and whether the volume can be controlled, with the exact fix if something is missing.

To lock automatically, point your idle daemon at it:

swayidle -w timeout 300 'ahfail' before-sleep 'ahfail'   # Wayland
xss-lock -- ahfail                                       # X11

macOS

On a Mac the system lock screen does the locking, and the effect comes from a PAM hook installed through Homebrew:

brew tap asger-weirsoee/tap
brew install ahfail

Homebrew then prints the one line to add to /etc/pam.d/screensaverui. That's the only manual step.