[hackers][slock] making slock set the keyboard layout to English before locking the screen

From: Lancia Greggori <lanciagreggori_AT_gmail.com>
Date: Tue, 18 Oct 2022 12:47:54 +0330

Hi gentleman, as the title suggests, I need slock to automatically set the
keyboard layout to English because sometimes my keyboard layout is in
another language when slock locks the screen and this causes my typed
password to be rejected by slock as incorrect because it has been entered
in foreign characters.

What I have tried so far:

1- using setxkbmap(1) with slock(1):

       $ slock setxkbmap us
      Authorization required, but no authorization protocol specified
      Cannot open display ":0"

      $ slock env setxkbmap us
      Authorization required, but no authorization protocol specified
      Cannot open display ":0"

2- editing slock.c and using system(3) to execute setxkbmap(1):

        system("setxkbmap us");

        /* everything is now blank. Wait for the correct password */
        readpw(dpy, &rr, locks, nscreens, hash);

output of slock(1):

       Authorization required, but no authorization protocol specified
       Cannot open display ":0"
       Terminated ---> guess: caused by root using killall(1)


I am not familiar with Xorg programming, but I am guessing there might be a
function or something that will set the keyboard layout to English.

Can anyone kindly give me pointers or hints?
Received on Tue Oct 18 2022 - 11:17:54 CEST

This archive was generated by hypermail 2.3.0 : Tue Oct 18 2022 - 11:24:38 CEST