for lock screen, gnome uses keyboard layout that was last used before locking the screen. Is there a possibility to configure gnome in such a way that it will always switch keyboard layout to some specific value for lock screen?
Example, how it works now: You have two layouts configured, en and abc. You've been entering some text using keyboard layout abc and then locked the screen by hitting Meta + L or placing your computer into sleep mode. Reaching lock screen, you find your keyboard layout is abc. You switch it to en and enter your password, unlock the screen and see that your active gnome desktop keyboard layout is abc.
Desired: You have two layouts configured, en and abc. You've been entering some text using keyboard layout abc and then locked the screen by hitting Meta + L or placing your computer into sleep mode. Reaching lock screen, you find your keyboard layout is en, because you managed to somehow configure gnome (or use some lock screen activation scripts/hooks?) to always switch to en for lock screen. Desktop keyboard layout after unlocking could be retained (abc), but this is of no importance in scope of given question.
I wrote a gnome extension, which resets keyboard layout when screensaver activates. You can access it on https://github.com/galets/gnome-keyboard-reset