You are not logged in.

#1 2024-02-14 21:25:57

Artyom
Member
Registered: 2017-03-27
Posts: 70

[SOLVED] KDE keyboard shortcut to lock session not working

Hello !

After reinstalling my laptop with the help of archinstall, I can't get the "WIN/Meta + L" shortcut to work properly.
The lock screen appears when I return from suspension, and the shortcut seems to be correctly configured in the settings.
When I press WIN/meta + L, it just makes the character "l".
Any ideas?

Thanks!

Last edited by Artyom (2024-02-17 19:35:19)

Offline

#2 2024-02-14 21:44:15

Xabre
Member
From: Serbia
Registered: 2009-03-19
Posts: 757

Re: [SOLVED] KDE keyboard shortcut to lock session not working

Default shortcut is actually Ctrl+Alt+L, though most reassign it to Meta+L. Just go to Shotcuts editor and add a custom shortcut to achieve what you need.

Offline

#3 2024-02-15 12:11:31

Artyom
Member
Registered: 2017-03-27
Posts: 70

Re: [SOLVED] KDE keyboard shortcut to lock session not working

Ctrl+Alt+L doesn't seem to work. Even custom shortcuts don't work.
I set them in "Shortcuts->Session management" and "Workspace behavior->Lock screen."
None of them work.
I use KDE if that helps.

Offline

#4 2024-02-15 14:20:29

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,333

Re: [SOLVED] KDE keyboard shortcut to lock session not working

Deos that have anything to do w/ your AltGr/wayland situation?
Fyi, AltGr != Alt

Do the shortcuts work as expected on plasma/X11?

Offline

#5 2024-02-15 15:21:09

Artyom
Member
Registered: 2017-03-27
Posts: 70

Re: [SOLVED] KDE keyboard shortcut to lock session not working

This does not seem to be the case.
AltGr has been working as expected since the last boot. Maybe logging in with X11 at some point helped it work in Wayland, but I can't prove it.
The session lock shortcut (native or custom) doesn't work in either X11 or Wayland.

Offline

#6 2024-02-15 15:32:24

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,333

Re: [SOLVED] KDE keyboard shortcut to lock session not working

On X11, run "xev -event keyboard", press the intended shortcut (cltr+alt+l) and post the xev output that produces.
Does

qdbus org.freedesktop.ScreenSaver /ScreenSaver Lock

work?

Offline

#7 2024-02-15 19:11:26

Artyom
Member
Registered: 2017-03-27
Posts: 70

Re: [SOLVED] KDE keyboard shortcut to lock session not working

xev output when meta+L and Ctrl+Alt+L are pressed

 xev -event keyboard
Outer window is 0x4200001, inner window is 0x4200002

KeymapNotify event, serial 24, synthetic NO, window 0x0,
    keys:  0   0   0   0   16  0   0   0   0   0   0   0   0   0   0   0   
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   

KeymapNotify event, serial 24, synthetic NO, window 0x0,
    keys:  0   0   0   0   16  0   0   0   0   0   0   0   0   0   0   0   
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   

KeyRelease event, serial 25, synthetic NO, window 0x4200001,
    root 0x60a, subw 0x4200002, time 2288986, (43,22), root:(914,465),
    state 0x10, keycode 36 (keysym 0xff0d, Return), same_screen YES,
"   XLookupString gives 1 bytes: (0d) "
    XFilterEvent returns: False

KeyPress event, serial 28, synthetic NO, window 0x4200001,
    root 0x60a, subw 0x4200002, time 2291340, (43,22), root:(914,465),
    state 0x10, keycode 133 (keysym 0xffeb, Super_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 28, synthetic NO, window 0x4200001,
    root 0x60a, subw 0x4200002, time 2291544, (43,22), root:(914,465),
    state 0x50, keycode 46 (keysym 0x6c, l), same_screen YES,
    XLookupString gives 1 bytes: (6c) "l"
    XmbLookupString gives 1 bytes: (6c) "l"
    XFilterEvent returns: False

KeyRelease event, serial 28, synthetic NO, window 0x4200001,
    root 0x60a, subw 0x4200002, time 2291621, (43,22), root:(914,465),
    state 0x50, keycode 46 (keysym 0x6c, l), same_screen YES,
    XLookupString gives 1 bytes: (6c) "l"
    XFilterEvent returns: False

KeyRelease event, serial 28, synthetic NO, window 0x4200001,
    root 0x60a, subw 0x4200002, time 2291750, (43,22), root:(914,465),
    state 0x50, keycode 133 (keysym 0xffeb, Super_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 28, synthetic NO, window 0x4200001,
    root 0x60a, subw 0x0, time 2452262, (-532,337), root:(339,780),
    state 0x10, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 28, synthetic NO, window 0x4200001,
    root 0x60a, subw 0x0, time 2452399, (-532,337), root:(339,780),
    state 0x14, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 28, synthetic NO, window 0x4200001,
    root 0x60a, subw 0x0, time 2452804, (-532,337), root:(339,780),
    state 0x1c, keycode 46 (keysym 0x6c, l), same_screen YES,
    XLookupString gives 1 bytes: (0c) "
                                       "
    XmbLookupString gives 1 bytes: (0c) "
                                         "
    XFilterEvent returns: False

KeyRelease event, serial 28, synthetic NO, window 0x4200001,
    root 0x60a, subw 0x0, time 2452888, (-532,337), root:(339,780),
    state 0x1c, keycode 46 (keysym 0x6c, l), same_screen YES,
    XLookupString gives 1 bytes: (0c) "
                                       "
    XFilterEvent returns: False

KeyRelease event, serial 28, synthetic NO, window 0x4200001,
    root 0x60a, subw 0x0, time 2453265, (-532,337), root:(339,780),
    state 0x1c, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 28, synthetic NO, window 0x4200001,
    root 0x60a, subw 0x0, time 2453307, (-532,337), root:(339,780),
    state 0x14, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False
qdbus org.freedesktop.ScreenSaver /ScreenSaver Lock

This command does not invoke the session lock. However, if I resume a suspended session, I have to enter my password as if the session were locked.
So maybe it's a problem with the way the session lock is invoked, not a keyboard shortcut.

Offline

#8 2024-02-15 19:59:13

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,333

Re: [SOLVED] KDE keyboard shortcut to lock session not working

xev shows you pressing first win+l and then ctrl+alt+l, neither is intercepted by any passive grab (from a shortcut daemeon)
Whether or not there's a subsequent problem w/ the locker, those combinations are NOT bound to any global shortcut - in doubt kglobalaccel isn't running?

Offline

#9 2024-02-16 11:52:04

Artyom
Member
Registered: 2017-03-27
Posts: 70

Re: [SOLVED] KDE keyboard shortcut to lock session not working

Oh. This shortcut is therefore not recognized, unlike others. Ctrl+Alt+Del, which invoke the logout screen, work perfectly.
What part of xev output tells you that the service is not triggered?
kglobalaccel seems to work:

systemctl --user status plasma-kglobalaccel.service
● plasma-kglobalaccel.service - KDE Global Shortcuts Server
     Loaded: loaded (/usr/lib/systemd/user/plasma-kglobalaccel.service; static)
     Active: active (running) since Fri 2024-02-16 12:30:18 CET; 21min ago
   Main PID: 1482 (kglobalaccel5)
      Tasks: 3 (limit: 18929)
     Memory: 9.1M (peak: 10.1M)
        CPU: 568ms
     CGroup: /user.slice/user-1000.slice/user@1000.service/background.slice/plasma-kglobalaccel.service
             └─1482 /usr/bin/kglobalaccel5

févr. 16 12:30:18 DELL-LAPT-GNDE systemd[1314]: Starting KDE Global Shortcuts Server...
févr. 16 12:30:18 DELL-LAPT-GNDE systemd[1314]: Started KDE Global Shortcuts Server.

Offline

#10 2024-02-16 13:35:47

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,333

Re: [SOLVED] KDE keyboard shortcut to lock session not working

For a passively grabbed key you'll not receive a key press/release event but a KeymapNotify event.
Idk enough about KDEs configuration or what's supposed to hold that shortcut, but neither win+l nor ctrl+alt+l act as global shortcut for anything on your system.

W/ "qdbus org.freedesktop.ScreenSaver /ScreenSaver Lock" not being able to lock the screen, do you get any error for that call?
Is the screenloacker active in "kcmshell5 kded"?

Offline

#11 2024-02-16 18:31:38

Artyom
Member
Registered: 2017-03-27
Posts: 70

Re: [SOLVED] KDE keyboard shortcut to lock session not working

Only when launched with "sudo" wich seems normal to me because plasma is launched at user level and not system level.

❯ qdbus org.freedesktop.ScreenSaver /ScreenSaver Lock
❯ sudo qdbus org.freedesktop.ScreenSaver /ScreenSaver Lock
[sudo] Mot de passe de gaetan : 
Could not connect to D-Bus server: org.freedesktop.DBus.Error.NotSupported: Using X11 for dbus-daemon autolaunch was disabled at compile time, set your DBUS_SESSION_BUS_ADDRESS instead

I don't see any "screenlocker" in the background services.

Offline

#12 2024-02-16 20:14:08

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,333

Re: [SOLVED] KDE keyboard shortcut to lock session not working

sudo qdbus org.freedesktop.ScreenSaver /ScreenSaver Lock

Don't do that. Ever.

I don't see any "screenlocker" in the background services.

pacman -Qs kscreenlocker
qdbus org.kde.kded5 /kded5 loadedModules # that's a guess, could be
qdbus org.kde.kded5 /org.kde.kded5 loadedModules # if not
qdbus org.kde.kded5 # will tell

Offline

#13 2024-02-16 20:48:55

Artyom
Member
Registered: 2017-03-27
Posts: 70

Re: [SOLVED] KDE keyboard shortcut to lock session not working

seth wrote:

Don't do that. Ever.

Of course, but why is that such a bad idea? Apart from using sudo.

seth wrote:
pacman -Qs kscreenlocker
qdbus org.kde.kded5 /kded5 loadedModules # that's a guess, could be
qdbus org.kde.kded5 /org.kde.kded5 loadedModules # if not
qdbus org.kde.kded5 # will tell
❯ pacman -Qs kscreenlocker
local/kscreenlocker 5.27.10-1 (plasma)
    Library and components for secure lock screen architecture
❯ qdbus org.kde.kded5 /kded org.kde.kded5.loadedModules
kwrited
networkmanagement
kscreen
remotenotifier
kcookiejar
appmenu
ktimezoned
statusnotifierwatcher
gtkconfig
networkstatus
kded_bolt
smbwatcher
plasma_accentcolor_service
baloosearchmodule
freespacenotifier
kded_accounts
smart
keyboard
proxyscout
plasmavault
khotkeys
ksysguard
bluedevil
kded_touchpad

So the module that manages the screen lock seems not to be loaded.

Offline

#14 2024-02-16 21:23:24

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,333

Re: [SOLVED] KDE keyboard shortcut to lock session not working

So the module that manages the screen lock seems not to be loaded

Correct, but there's also nothing in https://archlinux.org/packages/extra/x8 … eenlocker/ that looks like a kded module hmm

I'm out of my game, you'll need assistence from somebody actually using KDE - sorry.

Offline

#15 2024-02-17 19:35:00

Artyom
Member
Registered: 2017-03-27
Posts: 70

Re: [SOLVED] KDE keyboard shortcut to lock session not working

The session locks correctly if I use:

loginctl lock-session

Creating a custom keyboard shortcut that calls this command also works.

During a test where I deleted the entire ~/.config folder to restore the default settings, I noticed that no keyboard shortcut for locking the session is present in "Shortcut". On the other hand, if I go to "Workspace behavior -> Screen lock", a "META+L" shortcut is present but not functional.
What's even stranger is that once the settings in "Workspace behavior" have been viewed, the "META+L" shortcut now appears in "Shortcut", still non-functional. The shortcut labels are not translated and remain in English. All this suggests a real problem with KDE's shortcut management.
So my problem is partially solved. I can now lock the screen with the correct shortcut, but the shortcut normally provided by the system is inoperative.

Thanks for your help!

Offline

#16 2024-02-17 20:37:49

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,104

Re: [SOLVED] KDE keyboard shortcut to lock session not working

Works fine here and has worked fine here for forever. Do you potentially still have the old/outdated shortcut daemon installed? Have you cleaned out your orphans? https://wiki.archlinux.org/title/Pacman … _(orphans)

Offline

#17 2024-02-18 12:20:38

Artyom
Member
Registered: 2017-03-27
Posts: 70

Re: [SOLVED] KDE keyboard shortcut to lock session not working

It's quite the opposite, the system has just been reinstalled with archinstall.
When in doubt, I performed the commands anyway, but that didn't solve the problem.
In the screenshot below, you can see that there are no default keyboard shortcuts.
Screenshot-20240218-131804.png

Offline

Board footer

Powered by FluxBB