Ubuntu 18.04: Gnome lock screen refuse correct password
Solution 1:
I have the same issue and tried a lot of solutions offered around the internet. So far, the only work around that worked when this happens:
- Alt+Ctrl+F1 - switch to a different console and login as your user
-
sudo killall gnome-screensaver
- to kill the screensaver - Alt+Ctrl+F7 - switch back to your X screen, there will no longer be a screensaver
-
gnome-screensaver-command -l
to lock your screen again and now unlock with your password (it should work now)
Note that if I don't do #4, the screen continue to go blank after a few minutes of being logged in, which is why I figured I needed to do #4.
Edit from 2020: Yet another alternative, inspired by EChip's answer: setup a cron script that will switch language back to English when the screen lock dialog is detected:
# Allows to avoid situation when on screen lock language other than
# English is selected.
#
# Set up under user's cron like this:
# * * * * * env DISPLAY=:0 /bin/bash /storage/scripts/unlock_helper.sh > /home/your_user_name/log.txt 2>&1
#
# Prerequisite:
# Add the following line to you .profile:
# set | grep DBUS_SESSION_BUS_ADDRESS > ~/.DBUS_SESSION_BUS_ADDRESS
source /home/your_user_name/.DBUS_SESSION_BUS_ADDRESS
export DBUS_SESSION_BUS_ADDRESS
echo $DBUS_SESSION_BUS_ADDRESS
if (/usr/bin/gnome-screensaver-command -q | /bin/grep "is active");
then
/usr/bin/gdbus call --session --dest org.gnome.Shell \
--object-path /org/gnome/Shell \
--method org.gnome.Shell.Eval \
"imports.ui.status.keyboard.getInputSourceManager().inputSources[0].activate()"
fi
Solution 2:
My alternative is to remove screensavers(gnome-screensaver, xscreensaver) at all.
I can not do remember every time when I lock pc to switch layout to US.
The punishment here is incorrect password error in lock screen of screensavers.
Steps to lock screen with Super+L without screensaver but with login screen:
1. sudo apt-get remove xscreensaver
2. Remove xscreensaver from startup applications, if you add it before
3. Go to Settings>Devices>Keyboard and disable standart command (Super+L)
4. Create new custom shortcut (Super+L) for command
dm-tool switch-to-greeter
I am almost happy now
UPD: To turn off display, we can use command:
xset dpms force off
So now to pack "switch-to-greeter" and "display off" into one shell script and link it to the "Super+L" is not a big question