You are not logged in.

#1 2018-08-03 09:11:41

mat69
Member
Registered: 2010-08-17
Posts: 5

[SOLVED] Automatically Loading Custom .Xmodmap Has no Effect

I want to automatically load my custom .Xmodmap when logging in.
For reference I am using GNOME and GDM.

cat $HOME/.Xmodmap

! xev --> find the correct key code
! xmodmap -pke > .Xmodmap  --> store current map
! xmodmap ~/.Xmodmap --> load map for testing
keycode  66 = ISO_Level3_Shift ISO_Level3_Shift
keycode  30 = u U u U BackSpace BackSpace
keycode  31 = i I i I bracketleft bracketleft
keycode  32 = o O o O bracketright bracketright
keycode  43 = h H h H Return Return
keycode  44 = j J j J Escape Escape
keycode  45 = k K k K braceleft braceleft
keycode  46 = l L l L braceright braceright
keycode  57 = n N n N asciitilde asciitilde

I added debug-output to /etc/gdm/Xsession.
Therefore I know that the marked line of /etc/gdm/Xsession is executed

# xkb and xmodmap don't play nice together
if [ -z "$XKB_IN_USE" ]; then
    if [ -f "$rh6sysmodmap" ]; then
       xmodmap "$rh6sysmodmap"
    fi

    if [ -f "$sysmodmap" ]; then
       xmodmap "$sysmodmap"
    fi

    if [ -f "$usermodmap" ]; then
       xmodmap "$usermodmap" ####### is executed and points to my file
    fi
fi

For some reason my Xmodmap takes no effect.
Yet when I manually load it the keys are as expected.
It appears as if something changes the keys back.

Note: I also tried loading my key setup via xmodmap in .xinitrc, .xprofile and .profile.

Last edited by mat69 (2018-08-06 21:28:13)

Offline

#2 2018-08-03 12:22:43

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,843

Re: [SOLVED] Automatically Loading Custom .Xmodmap Has no Effect

Most likely by gnome, because the file is executed before gnome is started which will then apply its keyboard settings what's gonna nuke your modmap.
Rather put this into some autostart service/script.

Offline

#3 2018-08-06 21:28:46

mat69
Member
Registered: 2010-08-17
Posts: 5

Re: [SOLVED] Automatically Loading Custom .Xmodmap Has no Effect

Thank you. That does the trick.

Offline

Board footer

Powered by FluxBB