Bug 504232

Summary: Adding custom commands block themselves from being seen in shortcuts
Product: [Applications] systemsettings Reporter: luke
Component: kcm_keysAssignee: Plasma Bugs List <plasma-bugs-null>
Status: REPORTED ---    
Severity: normal CC: duha.bugs, fanzhuyifan, kde, nate
Priority: NOR    
Version First Reported In: 6.3.5   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Error seen in settings gui
Video reproducing bug

Description luke 2025-05-14 18:35:29 UTC
Created attachment 181302 [details]
Error seen in settings gui

SUMMARY
When adding a custom command/script as a keyboard shortcut, plasma will create a .desktop file with the "NoDisplay" attribute set to True. This is fine, as it is expected not to be displayed in any launcher menus. However, after setting the command and name, you get this error 

"Error while communicating with the global shortcuts service"

If you view the journalctl logs, you see this
org.kde.kcm_keys: "Error while calling objectPath of added applicationnet.local.<generated name>.desktop"
org.kde.kcm_keys: "org.kde.kglobalaccel.NoSuchComponent" "The component 'net.local.<generated name>.desktop' doesn't exist."

kcm keys cannot find the entry.

If you manually remove the "NoDisplay" attribute, and add the generated desktop file as an application, it correctly enters the "Commands" section as a custom command would 


STEPS TO REPRODUCE
1. Open systemsettings
2. Navigate to Keyboard > Shortcuts
3. Click Add New, and select "Command or script..."
4. Fill out details for a script
5. *** Observe error adding script

OBSERVED RESULT
Command/Script not added to shortcuts menu

EXPECTED RESULT
Command/script added to shortcuts menu as expected

SOFTWARE/OS VERSIONS
Linux: Arch, kernel 6.14.6-arch1-1
KDE Plasma Version: 6.3.5
KDE Frameworks Version:  6.14.0
Qt Version: 6.9.0
Comment 1 Nate Graham 2025-05-14 19:52:16 UTC
I'm not able to reproduce the issue on git master with those steps. Any chance you would attach a screen recording of you reproducing the issue? That would be super helpful. Thanks!
Comment 2 luke 2025-05-15 16:33:32 UTC
Created attachment 181347 [details]
Video reproducing bug
Comment 3 Nate Graham 2025-05-15 19:24:15 UTC
Thanks! Is the issue seen when adding a global shortcut for anything other than "rofi [something]"? Or is it only seen in that case?
Comment 4 luke 2025-05-15 19:27:15 UTC
It seems to be any global command. I've had it with rofi, 1password, and any custom sh scripts i make (ive also tried absolute paths, still doesn't work). Doesn't seem to be any specific command that does this.
Thanks for looking at this
Comment 5 Nate Graham 2025-05-16 14:26:57 UTC
Thanks. It's quite strange, and I can't reproduce it when I replicate your steps.