1

Ubuntu 11.10

First off, I'm completely new to Linux, as in I just partitioned my computer two days ago and installed Ubuntu. My tab key recently quit on me, and I would rather swap the caps lock and tab since they are in the same vicinity. I tried following this post;

How to swap/remap the CAPS LOCK key with Tab key?

but I am unable to run

xmodmap keycode  66 = Tab ISO_Left_Tab Tab ISO_Left_Tab
xmodmap:  unable to open file 'keycode' for reading
xmodmap:  unable to open file '66' for reading
xmodmap:  unable to open file '=' for reading
xmodmap:  unable to open file 'Tab' for reading
xmodmap:  unable to open file 'ISO_Left_Tab' for reading
xmodmap:  unable to open file 'Tab' for reading
xmodmap:  unable to open file 'ISO_Left_Tab' for reading
xmodmap:  7 errors encountered, aborting.

then when I tried to edit usr/bin/xmodmap, I get encoding errors in Gedit.

Any help??

clofal
  • 11

2 Answers2

1

To create instructions for xmodmap which get processed every time you login you will need to create a file called .Xmodmap file in your home directory. You can do this using the following command from terminal

echo keycode 66 = Tab ISO_Left_Tab Tab ISO_Left_Tab > ~/.Xmodmap

Next time you login the new keymapping will take effect. If you want to to work immediately use the following command from terminal:

xmodmap ~/.Xmodmap

Hope that helps.

cossovich
  • 994
0

If you manouvre to your home directory using Nautilus, press Ctrl+H to show hidden files.

Then locate the file .bashrc -- files or folder starting with a . are automatically hidden. In that file, add the line

xmodmap -e "keycode 66 = Tab ISO_Left_Tab Tab ISO_Left_Tab"

as mentioned in the comment to your question. Then save the file.

No effect will occur until you run a terminal. Once you have just opened the terminal window, the effect will occur. Further, it will revert on boot, but calling a terminal window will re-activate.

Rasmus
  • 8,375