You are not logged in.

#1 2018-07-21 21:40:15

raxod502
Member
Registered: 2018-07-21
Posts: 9

GDM doesn't load ~/.Xmodmap, but wiki says it does

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

#2 2018-07-21 22:07:45

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: GDM doesn't load ~/.Xmodmap, but wiki says it does

You can check /etc/gdm/Xsession. If it finds any sort of xkb configuration (such as ~/.Xkbmap), it ignores ~/.Xmodmap.

Offline

#3 2018-08-04 21:45:40

raxod502
Member
Registered: 2018-07-21
Posts: 9

Re: GDM doesn't load ~/.Xmodmap, but wiki says it does

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

#4 2018-08-04 22:05:53

raxod502
Member
Registered: 2018-07-21
Posts: 9

Re: GDM doesn't load ~/.Xmodmap, but wiki says it does

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

#5 2018-08-04 22:39:01

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: GDM doesn't load ~/.Xmodmap, but wiki says it does

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

Board footer

Powered by FluxBB