Please Ubuntu help me remap my keys…

I recently bought a Chromebook and found that after installing Ubuntu on it, the top row keys (apart from ESC and the power button) were mapped to the normal F keys (F1 to F10). Although this might be exactly what some prefer, I wanted the multimedia keys to work, especially the volume keys.

After some googling around I discovered that xmodmap was the way to go. I found the right keycodes and was able to get all the keys working, job done I thought…until I rebooted. The keys were back to being mapped as the F keys!

I went back to my friend Google and started seeing lots of people recommending startup scripts to run the xmodmap commands after logging in. Nope, that didn’t work either! Next was setting up a service in systemd, which I did. Hhhm, didn’t work either.

The problem seemed to be that these fixes worked for older versions of Ubuntu and not for the latest versions.

While trying these different solutions, I could feel it in my bones that a simpler way was possible, I just had to find it. The answer came in the form of a clue in one of the Ubuntu forums where someone mentioned that xmodmap is not used anymore in favour of xkb.

A-ha, the solution was easy after that, see how to remap keys on Ubuntu 15.04.