![]() Registered Member ![]()
|
Hi all,
I'm currently searching for a way to import an exported set of shortcuts from a .khotkeys file automatically. Only related information I've found is viewtopic.php?f=43&t=109524 Maybe also viewtopic.php?f=17&t=88836&p=165050 but that's only for KDE3 and it seems khotkeys_update does not exist anymore. Documentation also only talks about import via kcm module: http://docs.kde.org/stable/en/kde-works ... l/khotkeys So how to import shortcuts from a .khotkeys file via commandline? |
![]() Registered Member ![]()
|
Hmmm, when dropping the .khotkeys file into /usr/share/kde4/apps/khotkeys/ it gets automatically imported.
But it's not merged in the existing config, and I'm ending up with two groups of the same name, and even the predefined PrintScreen shortcut gets duplicated. So seems quite messy ... :/ |
![]() Administrator ![]()
|
In terms of importing shortcuts via CLI, you might want to take a look at the format of ~/.kde4/share/config/khotkeysrc - there doesn't appear to be a D-Bus interface i'm afraid. The configuration module appears to edit the configuration file directly and tell the daemon component to reload that.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Registered Member ![]()
|
Well, tried that already to merge my existing shortcuts manually into there, but didn't work quite that well. It's also ugly to parse. My workaround works pretty well so far, define the shortcuts in a fresh KDE install, put them in a separate group and name the group unique, then export that, check "allow merging" and also use a unique ID. The ID will be the field "ImportId" in the [Main] section, and khotkeys will automatically import it if the ID is different than the other ones in /usr/share/apps/khotkeys/ and has not been imported before. During distro customization just copying my exported shortcuts into /usr/share/apps/khotkeys/ takes care that they will be present after login. About the dbus interface, I've seen this:
I'm not that much into the dbus interfaces, do you know if this can be used to add shortcuts via dbus calls? Also the one below "org.kde.khotkeys.reread_configuration" could probably be used to reload khotkeys configuration? Didn't find any documentation about this so far ... |
![]() Administrator ![]()
|
Yes, I suspect "org.kde.khotkeys.reread_configuration" can be used to force the custom shortcuts system to reload it's configuration.
Unfortunately i'm not sure as to the purpose of "org.kde.khotkeys.register_menuentry_shortcut". In terms of documentation, this is an internal interface of sorts, so I would suggest checking with the actual source code behind the custom shortcuts system (khotkeys).
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered users: Bing [Bot], Google [Bot], kde-naveen, Sogou [Bot], Yahoo [Bot]