You are not logged in.
I use GDM/GNOME and have created ~/.Xmodmap with the following contents:
clear lock
clear control
clear mod1
clear mod4
keycode 66 = Control_L
keycode 133 = Alt_L
keycode 64 = Super_L
keycode 108 = Super_R
keycode 105 = Alt_R
add control = Control_L
add mod1 = Super_L Control_R
add mod4 = Alt_L Alt_R
When I run
$ xmodmap ~/.Xmodmap
it works fine. However, when I log out and log back in again, my customizations are lost. The wiki says at https://wiki.archlinux.org/index.php/xm … stom_table:
With GDM, XDM or LightDM there is no need to source ~/.Xmodmap.
So, why do I have to source ~/.Xmodmap every time I log in, given that I'm using GDM?
I am not using Wayland; my /etc/gdm/custom.conf is as follows:
# GDM configuration storage
[daemon]
# Uncoment the line below to force the login screen to use Xorg
WaylandEnable=false
[security]
[xdmcp]
[chooser]
[debug]
# Uncomment the line below to turn on debugging
#Enable=true
Offline
You can check /etc/gdm/Xsession. If it finds any sort of xkb configuration (such as ~/.Xkbmap), it ignores ~/.Xmodmap.
Offline
Thanks for the pointer. I think something else is wrong, though.
Firstly, I can verify that my ~/.Xmodmap works by running
$ xmodmap ~/.Xmodmap
Logging out and back in again, if I run
$ /etc/gdm/Xsession
in gnome-terminal, then it does in fact activate my Xmodmap configuration. So, it appears that /etc/gdm/Xsession is not actually run.
Further credence to this theory is given by the fact that
$ ack --ignore-dir=/proc "Beginning session setup" / 2>/dev/null
gives only one result, namely the echo statement in /etc/gdm/Xsession itself.
Offline
Update: it makes even less sense. I added additional logging statements to /etc/gdm/Xsession and forcibly redirected them to /tmp/gdm.log.
This revealed that in fact, /etc/gdm/Xsession *does* load my ~/.Xmodmap, and furthermore that it only does so *after* I log in. So, this is exactly what I would expect, except that the changes don't take effect.
What?
Offline
Then I suspect it's gnome applying its own keyboard settings and (maybe just like setxkbmap does according to the note in the wiki) resetting your modifications. Maybe you can have gnome run xmodmap during startup (assuming that puts it nearer the end, after gnome applies settings; or hack around that with `sleep`). I suppose gnome's keyboard settings don't allow you to remap keys like this?
Offline