SUMMARY Having migrated one computer to Plasma 6.1 (via Fedora Kinoite), I attempted to copy over my (~20) custom shortcuts which I use to launch applications and more. An example shortcut might be binding Meta+Ctrl+Alt+Shift+B to 'kitty neomutt' I was unable to copy these shortcuts over, either by copying over ~/.config/khotkeysrc and ~/.config/kglobalhotkeysrc, nor by using the 'Export...' function, saving all of them (making sure they're selected), then 'Import...' on the new machine. All of the other shortcuts (e.g. Khronkite) did copy, but those didn't. OBSERVED RESULT When Shortcuts -> 'Export...' then 'Import...' is used or kglobalhotkeysrc is copied over, no custom command shortcuts came with. EXPECTED RESULT Custom Command Shortcuts copied too. SOFTWARE/OS VERSIONS Linux/KDE Plasma: Fedora Linux 40 (Kinoite) KDE Plasma Version: 6.1.0 KDE Frameworks Version: 6.3.0 Qt Version: 6.7.1 ADDITIONAL INFORMATION
So, a bit more poking has revealed the issue, and allowed me to accomplish the task. Apparently, the custom shortcut commands are stored in ~/.local/share/applicatons as .desktop files. If you copy those over first, then copy in .globalshortcutsrc, then restart, the commands will work as anticipated. This is wildly unintuitive, though, and I would suggest that either: 1) This behavior be modified so that one file contains all the information needed, for easier cross-machine syncing 2) The shortcut-related desktop files be placed in a subfolder, so they can be synced too 3) The import/export chain automatically creates these desktop files Thanks!
Apparently your shortcuts were created using KHotkeys, which had been deprecated for 8 years and was removed with Plasma 6.1. There was a migration script to move simple ones over to the newer KGlobalAccel system, but we're aware it's not perfect. And unfortunately it can never be due to different sets of functionality between the two systems. It would probably be best to re-create them all from scratch to ensure they work properly with the newer KGlobalAccel system.
(In reply to Nate Graham from comment #2) > Apparently your shortcuts were created using KHotkeys, which had been > deprecated for 8 years and was removed with Plasma 6.1. > > There was a migration script to move simple ones over to the newer > KGlobalAccel system, but we're aware it's not perfect. And unfortunately it > can never be due to different sets of functionality between the two systems. > > It would probably be best to re-create them all from scratch to ensure they > work properly with the newer KGlobalAccel system. It's true that old shortcuts don't migrate, and khotkeys is abandoned, but even creating a new shortcut on a fresh install with Plasma 6, it doesn't appear to be possible to import custom shortcuts created in Plasma 6 on a different machine. So, this is not just an 'old shortcuts'. I recreated everything in Plasma 6, then went to migrate another machine to Fedora 40 and couldn't import without the desktop file hack below.
Let's back up. When you wrote ~/.config/kglobalhotkeysrc, did you mean ~/.config/kglobalshortcutsrc?
(In reply to Nate Graham from comment #4) > Let's back up. When you wrote ~/.config/kglobalhotkeysrc, did you mean > ~/.config/kglobalshortcutsrc? Yes, I'm sorry, I meant 'kglobalshortcutsrc', as I put in the title. I typoed later.
Got it. I thought you were talking exclusively about khotkeys. Can confirm the issue.
In progress with https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/2447.
Git commit b88e3456c2499c73e520407959af31d4d45a1925 by Akseli Lahtinen. Committed on 23/08/2024 at 15:46. Pushed by akselmo into branch 'master'. kcm_keys: fix importing custom commands This adds new handling for Custom Commands, such as exporting them as their own group. It also adds a signal that's emitted when an application is added to the list. When the signal is emitted, we re-import our config file to add the missing data. This is because otherwise we'll face asynchronicity issues. Most of the work was done by David Redondo already, I just applied his patch and modified it. FIXED-IN: 6.2.0 M +1 -1 kcms/keys/basemodel.cpp M +1 -0 kcms/keys/globalaccelmodel.cpp M +1 -0 kcms/keys/globalaccelmodel.h M +53 -2 kcms/keys/kcm_keys.cpp M +1 -1 kcms/keys/kcm_keys.h https://invent.kde.org/plasma/plasma-desktop/-/commit/b88e3456c2499c73e520407959af31d4d45a1925