I've recently switched to using the Gnome desktop environment, and most things work smoothly. However, I have two languages installed on my machine(Persian and English) and whenever the screen gets locked while the keyboard is set to Persian, I can't find a way to switch it back to English to unlock the screen. The only way I know of, is to restart the computer.
Searching the internet the only questionable "workaround" I could find was to purge
gnome-screensaver and install
xscreensaver. But this is not a real solution, because you still can't change the input language, all you can do is kill
xscreensaver from one of the non-graphical "virtual terminals".
I'm running Ubuntu 17.04 64-bit. Running the command
gsettings get org.gnome.desktop.input-sources sources outputs:
[('xkb', 'us'), ('xkb', 'ir')]
cat /etc/default/keyboard returns:
# Check /usr/share/doc/keyboard-configuration/README.Debian for # documentation on what to do after having modified this file. # The following variables describe your keyboard and can have the same # values as the XkbModel, XkbLayout, XkbVariant and XkbOptions options # in /etc/X11/xorg.conf. XKBMODEL="pc105" XKBLAYOUT="us,ir" XKBVARIANT="," XKBOPTIONS="grp:alt_shift_toggle,grp_led:scroll" # If you don't want to use the XKB layout on the console, you can # specify an alternative keymap. Make sure it will be accessible # before /usr is mounted. # KMAP=/etc/console-setup/defkeymap.kmap.gz BACKSPACE="guess"
As mentioned in the comments by Gunnar Hjalmarsson, one can avoid this problem if they switch from LightDM to GDM3.