2

I've wanted to remap my print key on my Thinkpad T460p because Lenovo decided it would be more useful than the context menu ("Menu" which is basically the right mouse-) button.

It tried a solution from this thread and did the following:

Using

xev | grep keycode

and pressing the print key got me its keycode which is 107. The only difference to this thread is my keycode and I've set its value to "Menu". I've also edited .Xmodmap to keycode 107 = Menu NoSymbol Menu

It works setting it temporary but after a reboot it's gone. And yes I've edited the xinitrc too.

Is there an easier way maybe with the help of a GUI? I just want to use my print key as a context menu.

Thx everybody

1 Answers1

1

This is a long shot, but maybe adding sleep 5 to ~/.xinitrc, like this:

if [ -f $HOME/.Xmodmap ]; then
        {
                sleep 5
                /usr/bin/xmodmap $HOME/.Xmodmap
        } &
fi

Edit:

It looks like ~/.xinitrc is not sourced in Ubuntu (with lightdm). Try ~/.xsessionrc instead.

Gunnar Hjalmarsson
  • 33,540
  • 3
  • 64
  • 94
  • That works. Thank you! Either it helped to add "sleep 5" or create the .xsessionrc file. It may also work adding sleep 5 to xinitrc but I didn't tried that :).

    Edit: Cannot upvote your answer because of my low reputation

    – Chronos90 Feb 02 '17 at 13:50
  • 1
    An example of a good long headshot :) – dgonzalez Feb 02 '17 at 14:55
  • Weird if I close my Laptop it is gone and does not work anymore :( It works again if I reboot my Laptop – Chronos90 Feb 03 '17 at 17:47
  • @Chronos90: Take a look here: http://askubuntu.com/questions/661715/make-a-script-start-after-suspend-in-ubuntu-15-04-systemd – Gunnar Hjalmarsson Feb 03 '17 at 18:23