Hi! Last weekend and this one, I wrote a GNOME Shell Extension that immediately locks the screen if a smartcard is removed.

You can checkit out here, and hopefully you’ll find it as useful as it is for me.

I was inspired by a Fedora Magazine article on using Yubikeys which uses udev rules in order to lock the screen.

But I not only found that a bit clumsy, it actually became a small hell as using pam_yubico triggers the event that’s used very frequently… so no, that wouldn’t do.

Also, since it’s “hardcoded” to GNOME, why not just make it an extension? So that’s the full story.

The project page includes a link to an action shot video.

Enjoy!