Originally Posted by
rumburak
I suffer the same problem that my custom shortcuts don't work.
There must be something wrong with the KHotKeys since a custom shortcut I defined in "main surface" (dunno the english translation since I use german localization - the german term is "Oberfläche zur Ausführung von Befehlen") for locking a session (WINDOWS+L) works out fine.
@flying_icarus
I tried your workflow but that does not help. Furthermore I have multiple entries for apps in my KHotKeys settings. See attached screenshot.
Additionally I can no longer start apps from the K-Menu. Starting by ALT+F2 works fine, but clicking the entry in the K-Menu has no effect (paths are correct/unchanged).
Ok, I will for now assume that the kmenu started working again, and concentrate ond khotkeys.
I have also noticed the duplicate entries, and found their source:
Code:
~/.kde4/share/config/kglobalshortcutsrc
They look something like this:
Code:
{6dad625b-0000-4000-be05-ed3e3cf362c3}=Meta+F,Meta+F,K Menu - firefox.desktop
If you delete such lines from kglobalshortcutsrc file and logout & login, they should be gone from the configuration gui. But apparently their appearance in there does not guarantee that the shortcut will work, the same key must be present in the
Code:
~/.kde4/share/config/khotkeysrc
as well, which in my case got created like this:
Code:
[Data_4_3]
Comment=
Enabled=true
Name=K Menu - firefox.desktop
Type=MENUENTRY_SHORTCUT_ACTION_DATA
[Data_4_3Actions]
ActionsCount=1
[Data_4_3Actions0]
CommandURL=firefox.desktop
Type=MENUENTRY
[Data_4_3Conditions]
Comment=
ConditionsCount=0
[Data_4_3Triggers]
Comment=Simple_action
TriggersCount=1
[Data_4_3Triggers0]
Key=Meta+F
Type=SHORTCUT
Uuid={6dad625b-0000-4000-be05-ed3e3cf362c3}
The Uuid in this case is the same for both, and if khotkeysrc process is not running, or if the khotkeysrc config file doesn't have the correct entry the shortcut again will not work.
So, try the following:
I have attached my khotkeysrc and kglobalshortcutsrc, go into .kde4/share/config in your home folder, rename your original files to something (i.e. add .bak at the end) and put my config files in their stead. Since they're default-generated apart from firefox, thunderbird and konsole additions, they should work on your system as well.
Now log out and back in so the kglobalshortcutsrc gets re-read.
Then open konsole and issue
Code:
# ps aux |grep khotkeys
If you see 2 lines (one will be from the "grep khotkeys" command above), and one of them just has "khotkeys" at the end, then you got khotkeys running, but maybe we should kill & restart it just to make sure it re-reads the configuration:
Code:
# pkill -15 khotkeys; pkill -9 khotkeys
After this the first command should list only "grep khotkeys" - that is our searching for the khotkeys process
Lastly, still in the command prompt, run the khotkeys again:
Hopefully you should see something like this while khotkeys starts up:
Code:
[icarus@andelain config]$ khotkeys &
[1] 11918
[icarus@andelain config]$ khotkeys(11919) KHotKeys::ShortcutsHandler::ShortcutsHandler: Initializing shortcuts_handler
khotkeys(11919) KHotKeys::ShortcutsHandler::addAction: Creating action for "{f36ee83f-0000-4000-8102-831412ef66c6}" - "PrintScreen" : QKeySequence("Print")
khotkeys(11919) KHotKeys::ShortcutsHandler::addAction: Finished creating action for "{f36ee83f-0000-4000-8102-831412ef66c6}" - "PrintScreen" : QKeySequence("Print") QKeySequence("")
khotkeys(11919) KHotKeys::ShortcutsHandler::addAction: Creating action for "{338b434f-0000-4000-ab55-5675442f8f9a}" - "K Menu - thunderbird.desktop" : QKeySequence("Meta+T")
khotkeys(11919) KHotKeys::ShortcutsHandler::addAction: Finished creating action for "{338b434f-0000-4000-ab55-5675442f8f9a}" - "K Menu - thunderbird.desktop" : QKeySequence("Meta+T") QKeySequence("")
((...and so on...))
Now try one of the shortcuts (in my config those are win+f, win+t and win+a) and see if it works.
If it does (as I hope it will), now we just need to make khotkeys run every time you log in, since it's not remembered in the session.
Create a file named i.e. khotkeys.sh in ~/.kde4/Autostart with the following contents:
Code:
#!/bin/bash
khotkeys &
and make it executable ("chmod +x ~/.kde4/Autostart/khotkeys.sh" in konsole or right click, properties, permissions, check "is executable"). This should make it start every time when you login.
Although this made it work for me in the end, it's definitely not as straightforward as it used to be. Hopefully it will improove in one of the 4.1.x releases so more people can begin using it.
Bookmarks