Run, Developer, Run!

How to force keyboard layout for XScreensaver screenlock

Always US layout in Xscreensaver Thumbnail

Always US layout in Xscreensaver

Always US layout in Xscreensaver

The pain only those using multiple keyboard layouts can understand. There is no more frustrating experience when you try to unlock your computer, type the password, fail, type password again, fail. Then you realize that had a chat window open before the screen locked, and your keyboard layout is in fact not default.

Losing time and being frustrated is something for Windows users. In Linux, we can fix it and be productive :)

  1. Install xkb-switch
    • This is a no-nonsense cli tool to switch layout, that actually switches layout. Not changes it like setxkbmap does
  2. First create (and make executable) script, which switches layout to us, then launches your favorite screensaver from /usr/lib/xscreensaver/. Of course, glmatrix, should be your favorite screensaver:

    xkb-switch -s us;
    /usr/lib/xscreensaver/glmatrix -root
  3. Edit ~/.xscreensaver, append to programs: section end:
         - GL:                                         \
                      /path/to/ \n
  4. Now you should be able to select in xscreensaver-command -prefs
  5. To test it run xscreensaver-command -lock



Me on Twitter, Mastodon and Github

We have RSS!

© 20xx

Hosted on Cloudflare Pages, which is awesome!