Run xmodmap at login

How in the blue schmoo do you run a xmodmap command when you login to your desktop session?

My objective is to map the menu key to nothing:

xmodmap -e ‘keycode 135 = NoSymbol’

When I run this in a terminal window after logging in everything works as expected but I’d like to have it run automatically every time I login.

I’ve put that command into .bash_profile and it doesn’t work.

I’ve put that command as a startup program for the Mate Desktop (main menu, system, preferences, personal, startup applications) and it doesn’t work.

I’ve put “keycode 135 = NoSymbol” (without the quotes) into ~/.Xmodmap and it doesn’t work.

I’ve created a file named ~/.xinitrc and put “xmodmap ~/.Xmodmap” (without the quotes) and that doesn’t work either.

:thinking:

I just hit that damn Menu key again by accident and got annoyed enough to look into this again.

Now I can answer my own question.

I almost had it right before.

Putting that command (xmodmap -e ‘keycode 135 = NoSymbol’) into the Mate “startup applications” works if you set the delay field to something greater than zero. I tried five seconds and now it works as expected.

A zero delay must run the command before the keyboard is initialized.