You are not logged in.

#1 2012-11-11 10:59:18

dundee
Member
Registered: 2010-09-05
Posts: 16

Xmodmap under systemd and GDM

Hi,
I'm using command "xmodmap ~/.Xmodmap" in my .xinitrc to remap some keys in Gnome/XFCE, but after switch to systemd, it stopped working. I have to execute the command manually and the changes expire after some time and I have to execute it again.

Does anybody have idea how to solve this? Thanks

Daniel

Kernel 3.6.6, x86_64
GDM + Gnome 3.6 / XFCE 4.10
booting with Systemd

Offline

#2 2012-11-12 02:29:52

Lord Bo
Member
Registered: 2012-11-11
Posts: 168

Re: Xmodmap under systemd and GDM

Well it would be interesting to know, which systemd service is responsible for loading the X11 keymap. You can try to find that out (list them with systemctl). I am afraid, I can't tell you, which one is responsible. But I experienced Problems whilst Xmodmap in a Desktop environment, too. Desktops sometimes seem to have their own handling of keysyms. I know, that it is not a real solution for your Problem, but I can give you two Tips: If you just want to remap single keys: Create a systemd service using setkeycodes to remap kernel scancodes to keycodes. This is a solution which from my experiece always works, since it remaps keys as soon as possible. Of course, this solution will not only remap keys under X, but also in virtual console. The second possibility, which might work, is to modify the X11 keyboard layout (or maybe to create an own) by hand. Keyboard layouts for X11 seem to be stored in a subdirectory of /usr/share/X11/xkb.

Hope that helps

Benjamin

Offline

#3 2012-11-12 20:56:39

dundee
Member
Registered: 2010-09-05
Posts: 16

Re: Xmodmap under systemd and GDM

Thanks for the clue, I finally solve it using udev rule which is (according to wiki) prefered over setkeycodes.

I made a package for it, perhaps somebody will like it: https://aur.archlinux.org/packages/lenovo-t420-keymap/

Offline

#4 2012-11-12 21:05:10

Lord Bo
Member
Registered: 2012-11-11
Posts: 168

Re: Xmodmap under systemd and GDM

dundee wrote:

Thanks for the clue, I finally solve it using udev rule which is (according to wiki) prefered over setkeycodes.

Thank you, thats good to know. Do you mind to share the wiki page concerning this subject?

Offline

#5 2012-11-12 21:18:22

dundee
Member
Registered: 2010-09-05
Posts: 16

Re: Xmodmap under systemd and GDM

Offline

#6 2012-11-12 21:56:39

Lord Bo
Member
Registered: 2012-11-11
Posts: 168

Re: Xmodmap under systemd and GDM

Great, thank you!

Offline

#7 2012-11-27 21:08:43

jessesherlock
Member
Registered: 2012-11-27
Posts: 2

Re: Xmodmap under systemd and GDM

Thanks dundee, that package was a great example for me to set up my own keymaps. It was very annoying to lose my capslock->escape .Xmodmap configuration every time I suspended my laptop or changed the resolution.

For future searchers:

Determine the relevant scancode(s), keyboard device(s) and keycode(s) as in the wiki page posted by dundee (https://wiki.archlinux.org/index.php/Ma … o_keycodes)

Get the appropriate device attribute/identifier for udev using "udevadm info -a -p $(udevadm info -q path -n /dev/input/eventX" as described here: https://bbs.archlinux.org/viewtopic.php?id=146305

Use dundee's package as a skeleton and change as appropriate.

Offline

Board footer

Powered by FluxBB