2

I have 2 languages "en" and "ru". Every time I log in, the logon screen requires my password which is English. When I change language to English on the logon screen it switches back to the previous one I was using. How to lock the language, so when I change it on the logon screen it will be the same after Ubuntu is unlocked? I have Ubuntu 20.04 installed, but the issues was on Ubuntu 19.10 too.

Thank you!

2
  • Pavel.. Are you changing language at login screen frequently? Login Screen n Desktop have different configurations.. if you want to have same language that what was present at login screen just b4 login it requires a workaround.. are you sure you regularly changes language at login screen n once login you want that same language on Desktop??
    – PRATAP
    May 17, 2020 at 16:01
  • will this be helpful? check askubuntu.com/q/1222879/739431
    – PRATAP
    May 17, 2020 at 16:13

3 Answers 3

0

Would switching the session language give the desired result? [Taken from help.ubuntu.com]

Ubunto 20.04 switched to using ibus, which if I recall correctly has a handy little keyboard shortcut <Alt>+<Shift>+L for toggling between languages. This would be a good solultion to keeping both languages while not interrupting workflow.

0

Thank you everyone,for the quick response. Actually I didn't have issues with languages, but with keyboard layouts.

Use case: When I lock the screen switch keyboard to "En", login to the system and open e.g. Remote Desktop client, try to connect to a server and it can't connect, because I have not "En" keyboard in the system, but the last used one which is in the most cases "Ru".

I sorted this out with standard settings: Open Settings - Region & Languages - Input Sources - set "Allow different sources for each window"

Thank you for the help once again.

0

the answers don't really solve the problem. there are open bugs that don't allow using super+space to work at all on lock screen, and setting Allow different sources for each window do not help either, since the determining language for the lock screen (at least on 22.10 and GNOME 43) is the last used input layout.

a tested answer for GNOME 42+ that directly addresses the question is this:

this solution creates a script that will listen to lock screen events (via org.gnome.ScreenSaver), and change the language using the GNOME extension and app g3kbswitch.

  1. install g3kb-switch https://github.com/lyokha/g3kb-switch according to the instructions in github (pull, install dependencies, compile and install app and extension)

  2. find the language id that you want to have in the lock screen by running gdbus call --session --dest org.gnome.Shell --object-path /org/g3kbswitch/G3kbSwitch --method org.g3kbswitch.G3kbSwitch.List (you should get output like (true, '[{"key":"0","value":"us"},{"key":"1","value":"il"}]') and if you want "en" to be the lock screen language, you'll need to use the key 0)

  3. create a script, call it e.g. lock-screen-lang.sh, and replace 0 in Set 0 with the key from the previous step:

#!/bin/bash
dbus-monitor --session "type=signal,interface=org.gnome.ScreenSaver" |
  while read MSG; do
    MSG_STAT=`echo $MSG | grep boolean | awk '{print $2}'`
    if [[ "$MSG_STAT" == "true" ]]; then
      gdbus call --session --dest org.gnome.Shell --object-path /org/g3kbswitch/G3kbSwitch --method org.g3kbswitch.G3kbSwitch.Set 0 > /dev/null 2>&1
    fi
  done
  1. give the script executable permission: chmod +x lock-screen-lang.sh

  2. add the script to GNOME startup by running gnome-session-properties, and adding a new item, selecting the script you've created.

note: although this is a workaround, since the bugs for this are opened for years, it's probably worth having.

related bugs:

resources:

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .