Hello everyone!
I've created a gameboy emulator to unlock my Wayland session and wanted to share this project to everyone here!
I've been a Linux enthusiast since I was a kid. What always captivated me was the freedom to customize my system exactly the way I wanted. With Wayland, we've reached an incredible level of performance. It's like turning your operating system into a video game! I've always been fascinated by the blend of fun and the serious, technical nature of an OS. That’s what inspired me to create this project.
I started by studying Wayland, its protocol and how to build a compositor. Then I became particularly intrigued by the concept of a locker, which reminded me a bit of an escape game. That’s when I thought: how cool would it be to solve a puzzle to unlock your session, instead of just typing a password? Since I’ve worked with emulators in the past and I’m a huge Pokémon fan, the idea of building the puzzle around that game came to me instantly!
Technically, the locker code and the wayland protocol have been implemented from scratch ( using EGL and wl_keyboard_listeners ). My locker runs a version of the gbcc emulator modded by myself. This emulator waits for one precise value to be set in a given memory address.
I have modded the Pokémon game to my needs: when the password is good, I put the good value in the good memory address so the emulator knows it needs to unlock the session.
Hope you will appreciate this project!
FWIW, as a ... Wayland skeptic/pessimist¹, screen locking does seem to be one place where things actually work and seem more sensible than under X.
¹ It always seems to be just around the next corner. Sixteen years on, it would be nice if we could have feature parity.
From my understanding, the security decisions around things like screen locking are the source of many of the pain points holding back X11 users from wayland.. Things like xtest(send input events from random sources), screen grabbing/video recording(allowing another app to see the contents of another window from a potentially different security domain), focus grabbing, input sniffing, are all difficult on wayland, specifically because they are serious security issues on X11, especially in light of a modern understanding of the risk profile.
Yes, many of Wayland's problems come down to particular ideas about security at the expense of functionality. But IMHO screen locking is a rare exception because the overly restrictive approach is actually fairly reasonable here, and the set of features to (not) implement is smaller.