This question already has an answer here:

This is what i do

xmodmap -e "keycode 135 = g"

but i lost it everytime i shutdown/restart my computer. I use ubuntu 14.04. Please someone can help me to make this change be permanent?


marked as duplicate by Thomas Ward, Ravan, Eric Carvalho, David Foerster, hg8 Nov 22 '15 at 11:02

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


You may potentially wish to put this into /etc/rc.local. rc.local runs during the boot process, specifically at the end of the boot process. It permits you to run certain commands at boot, but before you login.

This may be one option for making these changes. However, note that this isn't a permanent solution later - if /etc/rc.local is changed or overwritten, you will have to put this back into /etc/rc.local of your own accord.

You will need superuser to edit this. Either sudo nano /etc/rc.local for editing it in a command line, or pkexec gedit /etc/rc.local to edit it from the GUI program gedit.


You must make sure to keep exit 0; at the end of rc.local! This is to ensure that it 'exits' with a 'no failure' code, otherwise you could have other tiny but annoying issues crop up during the boot process (such as errors in dmesg or otherwise indicating you had a problem during boot).

  • Sorry, but didnt work. – Matheus Martins Jerônimo Nov 16 '15 at 19:36
  • @MatheusMartinsJerônimo if it didn't work you can unaccept this answer and accept your own – Thomas Ward Nov 16 '15 at 20:13

For those with the same problem, here's one solution:



Not the answer you're looking for? Browse other questions tagged or ask your own question.