Keyboard layout gets reset after a while

Hi everyone!
The problem is just that: after a while the international layout doesn’t work anymore. What could be causing this behavior? I’m not sure myself, as it isn’t constant – it just happens.
To set the layout I run:

exec_always --no-startup-id setxkbmap us -variant intl

in i3 config file before anything else, and obviously I don’t run the command setxkbmap again; at first I ran exec, but in an attempt to fix this weird behavior I started using exec_always.
A fix to this bug is reloading i3, but although easy it’s annoying nonetheless

1 Like

Welcome to the forum! :partying_face:

I have noticed problems when using input methods while changing keyboard layout. Could you confirm that you aren’t running any Input Method Editor?

Edit: Some Gnome apps, like the Screenshot app, can reset the layout when they are launched. Do you see such a pattern?

Thank you!

Just checked, I’m not running any IME.

I use spectacular. Anyway, I ran some gnome apps but it worked just fine

EDIT: perhaps it’s not related but when I login the windows on the first workspace aren’t in the position I set them (they are moved of ~50 pixels toward the bottom). Again, to fix this I reload i3 and then it works just fine

1 Like

Isn’t intl the default variant?

i3 only sets the keymap. Its being reset probably because the keyboard is temporarily disconnected. Maybe some power save measure kicking in. One permanent way to fix it is to use localectl to define keymap.

localectl set-keymap --no-convert us

I am not sure how you define the intl variant explicitly.

It MAY be that telegram notifications cause the bug, although I just received another one and it’s fine (after I reloaded i3)

setxkbmap sets the keyboard layout for the current X session only, but can be made persistent in xinitrc or xprofile. This overrides system-wide configuration.

But if you want to set this systemwide it would not need to run this per session, there is localectl for this to set permanent

5 Likes

Mmh, that doesn’t work. I have to type the command at every login
I tried by using:
localectl --no-convert set-x11-keymap us pc105 intl

It seems this works for some softwares (such as firefox, libreoffice) and not for others (kitty, telegram, kate)