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

From: Daniel Littlewood <danielittlewood_AT_gmail.com>
Date: Tue, 18 Oct 2022 17:16:50 +0100

Hi Lancia. Does "setxkbmap us && slock" do what you want?


On Tue, Oct 18, 2022 at 10:23 AM Lancia Greggori
<lanciagreggori_AT_gmail.com> wrote:
>
> 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 - 18:16:50 CEST

This archive was generated by hypermail 2.3.0 : Wed Oct 19 2022 - 10:12:38 CEST