21 August 2019

Can't unlock KDE Session

If for some reason you're unable to unlock your desktop, then probably is the permissions of kcheckpass. You have two choices:

1) Reinstall kde-plasma/kscreenlocker
2) Check the permissions of /usr/lib64/libexec/kcheckpass, it should be 4755 and owned by root:root
3) A more radical solution:
#!/bin/bash

# Screen locker broken in KDE with ConsoleKit
# See https://forums.gentoo.org/viewtopic-t-1046566.html
# and https://forums.gentoo.org/viewtopic-t-1054134.html

# Find which session is locked
session=Session$(ck-list-sessions | grep -B10 "x11-display = ':0" | grep -o -P '(?<=Session).*(?=:)')

# Create Bash script to unlock session
echo "#!/bin/bash" > $HOME/unlock.sh
echo "su -c 'dbus-send --system --print-reply --dest=\"org.freedesktop.ConsoleKit\" /org/freedesktop/ConsoleKit/$session org.freedesktop.ConsoleKit.Session.Unlock'" >> $HOME/unlock.sh
chmod +x $HOME/unlock.sh

# Run Bash script in another TTY
openvt -s -w $HOME/unlock.sh