Change language layout in screen lock

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?


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)


[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
    else
        setxkbmap -option grp:switch,grp:alt_shift_toggle,grp_led:scroll us,il
    fi
  done