DEV Community

Cover image for Mouse Unlock!—no password, just a secret click pattern
Dixit Ram
Dixit Ram

Posted on

Mouse Unlock!—no password, just a secret click pattern

My 10-year-old laptop has no fingerprint sensor. No Face ID. Just a keyboard.

And I was typing a 10+ character password every single time I locked my screen.
Lock. Type. Unlock. Lock. Type. Unlock. Repeat 40 times a day.

So I thought — my mouse has 3 buttons. What if clicking them in a secret pattern could unlock the screen instead?

2 left clicks → 2 right clicks → 1 left click. Screen unlocked.

I'm running Linux (Fedora + KDE Plasma) on a decade-old machine, so I asked Claude Code to build it from scratch. It wrote a Python daemon using evdev that:

  • Reads raw mouse events directly from /dev/input/ (works even on Wayland lock screen)
  • Checks if the session is locked via loginctl
  • Matches your registered click pattern → fires loginctl unlock-sessions
  • Runs as a systemd service at boot

The whole thing is ~150 lines of Python. No PAM hacks. No special hardware.

Is it secure? Absolutely not — but neither is a laptop old enough to be in 5th grade. 😅

Old laptop. No biometrics. Zero excuses now. 🖱

Linux #KDE #Python #Wayland #DIY

Top comments (0)