Bug 483979

Summary: Can't remove custom keyboard shortcuts (added as commands) after updating to plasma 6 - after removing and rebooting they appear back again.
Product: [Applications] systemsettings Reporter: Michał Harłacz <michal.harlacz.2k7>
Component: kcm_keysAssignee: Plasma Bugs List <plasma-bugs-null>
Status: CONFIRMED ---    
Severity: normal CC: breakingspell, kde, michal.harlacz.2k7, nate, nicolas.fella, tomashnyk
Priority: NOR    
Version First Reported In: 6.0.2   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Michał Harłacz 2024-03-19 08:46:23 UTC
SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***


STEPS TO REPRODUCE
1.  Set a shortcut for a command in plasma 5.
2.  Update to plasma 6.
3. Notice, that after removing the shortcut and rebooting it goes back.

OBSERVED RESULT
The shortcut appears after reboot again. (Tried removing kglobalshortcutsrc file, didn't help)

EXPECTED RESULT
The shortcut should stay removed.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 6.8.1-arch1-1 / plasma 6.0.2
(available in About System)
KDE Plasma Version: 6.0.2
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.2

Using Wayland
Comment 1 Nate Graham 2024-04-11 01:06:41 UTC
How exactly did you create these shortcuts in Plasma 5?
Comment 2 Bug Janitor Service 2024-04-26 03:46:24 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 3 Michał Harłacz 2024-04-26 06:08:06 UTC
Those shortcuts were placed under custom shortcuts - as a command executed on key press. After the merge of global and custom shortcuts in Plasma 6 they are impossible to remove (clearing the khotkeysrc and kglobalshortcutsrc doesn't solve this). I can attempt to remove the shortcut in the settings, but when the session restarts (e.g. i log out and back in) the shortcuts are back.
Comment 4 Nate Graham 2024-04-26 12:13:32 UTC
Hnm, that is not making much sense to me.

> I can attempt to remove the shortcut in the settings
This should not be possible; the settings UI for khotkeys was deleted for Plasma 6. Do you somehow still have khotkeys packages installed or something?
Comment 5 Michał Harłacz 2024-04-27 22:02:15 UTC
Khotkeys package isn't installed. The custom shortcuts were automatically imported into global shortcuts when upgrading the plasma. I just can't remove them without them reappearing next time a session is started.
Comment 6 Blazer Silving 2024-09-01 05:05:51 UTC
Noticed this bug after redoing some macros, same deal: Old Custom shortcuts carried in from the Plasma 5-6 khotkeysrc migration would reappear on each session after removal in the new Shortcuts panel. Running latest 6.1.4 with Plasma 5 packages removed. 

On my three profiles (desktop/work/laptop), this was due to the old shortcuts remaining in two places: 
~/.config/khotkeysrc 
~/.local/share/kglobalaccel/{uuid}.desktop (these notably had 0600 permissions)

Moving these files away leaves only the proper kglobalshortcutsrc entries, these can be added and removed and behave as expected. This can be easily replicated by just restoring a backup of these legacy files, they should probably be properly cleaned up once migrated to kglobalshortcuts.

Altering permissions on the kglobalaccel desktop entries doesn't seem to make a difference, systemsettings will remove the UI entry with the red trash can until the next session, but the filesystem doesn't change. 

Pulling the files by hand worked in all three cases for me, but this may be a quick fix in the shortcut removal routine code, if it's seeking the wrong config files or hitting a permission issue. Took a quick glance at the plasma-desktop and kglobalaccel code but couldn't find the area that handles this cleanup/removal.
Comment 7 tomashnyk 2025-08-19 09:07:07 UTC
This still happens on Plasma 6.4. 

I an confirm that removing ~/.local/share/kglobalaccel/{uuid}.desktop (or just ~/.local/share/kglobalaccel/ ) solves the issue for me.

So it sounds to me like Plasma is still reading that, but not writing into it when changing the config (also, this should be set to confirmed, there are already six of us who reported this).

To reproduce this, place
{c9054e92-0c8d-4b5a-bb9c-045713b8b3d9\}.desktop into ~/.local/share/kglobalaccel$  
with this content:
#!/usr/bin/env xdg-open
[Desktop Entry]
Exec=/usr/local/bin/turn_off_screen
Name=Turn Off Screen\s
StartupNotify=false
Type=Application
X-KDE-GlobalAccel-CommandShortcut=true

and have (solely) this as your ~./config/khotkeysrc:
[Data_4]
Comment=Turns off screen reliably
Enabled=true
Name=Turn Off Screen\s
Type=SIMPLE_ACTION_DATA

[Data_4Actions]
ActionsCount=1

[Data_4Actions0]
CommandURL=/usr/local/bin/turn_off_screen
Type=COMMAND_URL

[Data_4Conditions]
Comment=
ConditionsCount=0

[Data_4Triggers]
Comment=Simple_action
TriggersCount=1

[Data_4Triggers0]
Key=Pause
Type=SHORTCUT
Uuid={c9054e92-0c8d-4b5a-bb9c-045713b8b3d9}

and then run kcmshell6 keys