Ubuntu – .Xmodmap works only when automatic login disabled

xmodmap

I configured .Xmodmap after the answer I got here: How to set right Alt to work as a Win(Super) key?
It sets my R alt to Super key. It worked after log out and log in.
When I restarted the PC, the key has stopped working. I run xev, the system reported

 state 0x0, keycode 108 (keysym 0xffec, Super_R), same_screen YES

that this is SuperR but the key was working as AltR. Running manually xmodmap .Xmodmap filed an error that there is no AltR. After login aginn the AltR works as expected, with THE SAME stanza as above, but working key…
I disabled auto login and the configuration started to work as wanted.
Any ideas how to fix that, it seems to configuration fully works only f login screen was present.
PS I was never asked if I want to keep the custom configuration after login.

Best Answer

Add xmodmap ~/.Xmodmap to your .gnomerc (or equivalent) file.