Bug 397120

Summary: Global shortcuts imported from .desktop files do not refresh commands
Product: [Applications] systemsettings Reporter: Fabian Vogt <fabian>
Component: kcm_keysAssignee: Michael Jansen <kde>
Status: CONFIRMED ---    
Severity: normal CC: nate, nicolas.fella, plasma-bugs-null, tomashnyk
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Fabian Vogt 2018-08-03 09:30:59 UTC
When importing a global shortcut from a desktop file, which the keys kcm allows, the .desktop file is copied into .local/share/kglobalaccel/foo.desktop.

This means that any changes to the original .desktop file don't have any effect on the shortcut, which is highly unintuitive.

IMO this just needs to be documented or represented better in the UI.

Originally reported as https://bugzilla.opensuse.org/show_bug.cgi?id=1103680
Comment 1 Nicolas Fella 2022-08-16 18:47:37 UTC
I think this must have been fixed at some point. The kcm doesn't copy desktop files, it only pokes kglobalacceld to read the original desktop file
Comment 2 tomashnyk 2025-08-19 10:26:01 UTC
I can partially still confirm it. The changes are not picked up until reboot. Not even running systemctl --user restart plasma-kglobalaccel.service or even plasmashell --replace made it register. Only kwin --replace makes it register.

How to reproduce:
1) Run kcmshell6 keys and bind a shortcut to xterm (install it if you do not have it). This will add something like 

[services][xterm.desktop]
_launch=Ctrl+Alt+Shift+U

to ~/.config/kglobalshortcutsrc

2) In startup menu, search for xterm, right click it and select "Edit Application..." and put "-cr green" to Command-line arguments. That will create 
/.local/share/applications/xterm.desktop

with a line Exec=xterm -cr green

It should make xterms start with a green cursor and it works when xterm is launched from Start menu (or krunner or Application dashboard).

3) Your shortcut from step 1) will still start xterm without green cursor. Rebooting or restarting kwin solves the issue.

However, I think that editing the application in step 2) should run something that would make the change of the desktop file known to kwin (ideally without restarting it).

There is also https://bugs.kde.org/show_bug.cgi?id=493220 which might be a duplicate but I am not sure.