I'm Xubuntu 14.04.2 user. I have two keyboard layouts: Russian and English. Sometimes when I close my laptop and then go back and try to continue to work, Xubuntu wants me to enter my user password (my password consist of English letters and numbers).

However, often my keyboard layout was set to Russian and switching keyboards doesn't work.

I need restart my laptop to fix it.

How should I proceed?

  • Which is your default keyboard? Russian? If yes, use Cyrillic characters for your password... – Fabby Mar 24 '15 at 19:03
  • Thanks for a comment, but keyboard layout don't always is Russian... – Mister G Mar 27 '15 at 10:44

I have the exact same problem as you and I get around by doing this:

  • get rid of gnome-screensaver by:

    sudo apt-get purge gnome-screensaver
  • Install the X screensaver by:

    sudo apt-get install xscreensaver xscreensaver-data xscreensaver-gl

Whenever you forgot to switch back to English before the system locks itself, hit Ctrl+Alt+F1 log in as your admin user and kill -9 xscreensaver and you're back in!

(It's just a workaround and not a real "solution" but it works for me and is definitely better then shutting down and restarting)

  • this solution somehow messed my graphics-card configuration. reversing to prev state solved it. – ozma Jul 26 '16 at 10:54
  • @ozma sorry to hear that. Above is in no way related to graphics card subsystem so shouldn't have had any effect. Good to hear you solved it though... ;) – Fabby Aug 15 '16 at 23:43
  • 1
    Thanks @Fabby. I believe it is more a greeter issue rather than graphics (lightdm, sddm etc.). Anyway, I've upgraded to 16.04 and this greater issue has gone. – ozma Aug 16 '16 at 6:38

[Edit] This might be a workaround but right now its messing with other layout switching keybindings

[Original] This one worked for me BUT I couldn't run it on startup and keep it running in background.

Listen to lock signal and change layout to the one of your password. (ugly workaround but seem to work)

dbus-monitor --session "type=signal,interface=org.gnome.ScreenSaver" | 
  while read MSG; do
    LOCK_STAT=`echo $MSG | grep boolean | awk '{print $2}'`
    if [[ "$LOCK_STAT" == "true" ]]; then
        setxkbmap us
        setxkbmap -option grp:switch,grp:alt_shift_toggle,grp_led:scroll us,il

Ubuntu 16.04 use another interface name:

dbus-monitor --session "type=signal,interface=com.canonical.Unity.Session" | 
  while read MSG; do
    LOCK_STAT=`echo $MSG | egrep -o member='.*' | cut -d '=' -f 2`
    if [[ "$LOCK_STAT" == "Locked" ]]; then
        CURRENTL=$(setxkbmap -query | grep layout | awk '{print $2}')
        echo "Locked with current layout ${CURRENTL}"
        setxkbmap us
    if [[ "$LOCK_STAT" == "Unlocked" ]]; then
        setxkbmap $CURRENTL
        echo -n "Returning to"
        setxkbmap -query | grep layout

xscreensaver is great but the maintainer, JWZ, has made clear that he has no intention of supporting multiple keyboards.

xsecurelock is a better solution. It supports switch keyboard layouts from within the screen saver and will also give you a bold red notice if caps lock is on. It doesn't have a built-in timer like xscreensaver does so you'll need to follow the instructions on their webpage to get it to run automatically after a timeout.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.