I have been fighting with the problem for three days now. I have a computer that I am setting up for a friend and I have Zorin OS 12 on it since it was the first thing that came to mind that was Windows like, and I would know how to work with it since it's based on Ubuntu. Anyways, since I have it running on an old Macbook I had laying around, I don't have a right click so I used this command thing to map it to a key. This is the code that I'm using that I used chmod a+x to make it executable.

xmodmap -e "keycode 134 = Pointer_Button3"
xkbset m

But I've tried rc.local, init.d, init, even startup applications, and yet none of them work! So I'm starting to think it's something wrong with the script, but it works perfectly fine doing it manually! The other thing that's weird is that when I check to see if rc.local is working it says that its working fine, but after I put the command in and restart it says that there's a compatibility error or something next time I check.


2 Answers 2


xmodmap and xkbset are commands that runs in xorg. Try to put your script in your xinitrc https://wiki.archlinux.org/index.php/Xinit

On recent ubuntu based distro you can autostart a program after GUI logon as described here

  • I think that's only for distros based off of BSD and other ones. I tried doing 'sudo apt-get install xorg-xinit' but it says that it doesn't exist. Feb 24, 2017 at 22:47
  • Take a look to my edit and let us know :-)
    – sgargel
    Feb 25, 2017 at 20:38
  • Hi, sorry for replying do late, but I tried that and unfortunately it didn't work. I'm starting to think it something wrong with the code, but I don't know. :/ Mar 14, 2017 at 20:50

rename the file with the name that you can remember and then copy it into /bin. Check by typing the name of the command/file that you recently copied. If it is working then add this name in /etc/rc.local file.

I Hope this works for you.

  • I tried that but it didn't work. I think it was because my rc.local went haywire once I tried to do it for the first time. The only way to fix it would be to do a complete install again, and redo everything I did again. But even then after I would put a command in, and restart, and checked it, it would get mad at me and start throwing compatibility errors. Feb 24, 2017 at 23:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .