using Mac computers for few years, I got accustomed of using the Cmd key on the keyboard as a standard Ctrl key.
With Ubuntu 13.04 on my Macbook Pro 5,3 (2009), the Cmd is used for Unity controls, and Ctrl for applications shortcuts. Is there any way to switch the two keys? So that, as an example, close a tab in Firefox would be Cmd+W instead of Ctrl+W?
Best Answer
I found out a workaround. The solution is to use the xmodmap utility and make it load a personal file with the correct mapping for the keyboard.
Open a terminal and create a new file in your /home folder, lets call it
.Xmodmap
(I use nano as a nice text editor inside the console, you can use Gedit instead, install nano with the command sudo apt-get install nano if you'd like to test it, it's quite obvious to handle.)
Copy/paste the following content to the new file:
Make the file executable.
Test it now with the following command:
The dash should now appear with Ctrl instead of CMD, hurra!
Now we want the file to be executed each time the system starts up. Open the Startup Applications utility and add a new entry, name it as you want and put the following comand in it:
Reboot, it should be ok. If it is not, you should add a
.xinitrc
file in your/Home
folder, and add the command inside it. The.xinitrc
file will be read by the system while loading the desktop environment.