This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Loading Global Shortcuts Scheme from a script ?

Tags: None
(comma "," separated)
TheAbu
Registered Member
Posts
3
Karma
0
OS
Hello.

Since this is my very first post, a little presentation is in order I guess :)
I'm pretty much a noob since I started using Linux only about 5 months ago. I run Funtoo ~amd64 (a variant of Gentoo if you don't know it) and I really, really love it. I chose to use KDE as my desktop environment and it gets better and better with each release, so here too, I'm very happy :)

First, my setup :)
Logitech G11 keyboard (AZERTY) with the G15 daemon running.
KDE 4.2.4
Xorg 1.6.2-r1
Hal 0.5.12_rc1-r7
Xmodmap 1.0.3
Until recently, everything was fine, my keyboard layout was setup by hal and keyboard layout was turned off in kde (so my AZERTY keyboard worked fine and so did the shortcuts key).
After a recent update, I started to have issues :(( : basically, I sill had a perfectly working AZERTY keyboard in most KDE applications but Konsole or programs like vim ...
To solve that problem I had to turn on KDE keyboard layout functionalities. But ... once I did that, my shortcut global shortcut keys stopped working (it seems that KDE "erased" my custom Xmodmap when loading the French keyboard layout).
I managed to solve that by adding a delay to the script that load my Xmodmap (sleep 5). Now, my Xmodmap do work but every time I start my computer I have to go to system-settings -> keyboard and mouse -> Global Keyboard shortcuts, import a scheme (any of the presets) validate it, then reimport my saved preset (my guess is, when KDE start and load my preset, Xmodmap hasn't loaded yet so it doesn't really create the shortcuts since the keys doesn't yet "exist").

Now for my question (sorry for this very long preamble, it's not always easy for me to explain stuff in English :< ) Is there a way to load a Global Shortcut scheme using the command line so that I can automatize the process with a script.
I only start my computer once a day, so it's not a huge problem, but I love clean solutions :)

Thank you for any help in advance :)
TheAbu
Registered Member
Posts
3
Karma
0
OS
;D I will answer my own post in the hope it can be useful to someone, who knows ;)
I managed to solve my problem by splitting my Xmodmap in two parts and desactivating the keyboard layout management in KDE.
The first xmodmap get loaded by a script in ~/.kde4/env and is loaded before KDE4 actually starts. It takes care of the various additional keys available on the G11 keyboard and since it gets loaded before KDE4 actually start, the global shortcuts do "see" the keys and are affected correctly.
The second xmodmap get loaded by a script in ~/.kde4/Autostart and is used to swap the Caps Lock and Escape keys (I'm a heavy Vim user and it's soooooo much comfortable using the Caps Lock to Escape.) I added a "sleep 3" instruction in the script before it actually loads the keymap otherwise I had issues in Konsole (basically, when I used a key that require ISO_Level3_Shift, it didn't work as expected, no clue why).
Happy again xD


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Google [Bot], Yahoo [Bot]