search
top

Change keyboard layout from command line

I don’t want to start a debate about the best keyboard layout ever. However, I was pretty much open minded and decided to give Dvorák a try. I used it for a few months and I caught up with my original speed of qwerty.

To switch your keyboard layout to Dvorák:

setxkbmap -layout dvorak

Honestly, I feel more comfortable typing in Dvorák now than qwerty. However, if you want to keep using qwerty, here is how to change your layout back to qwerty:

setxkbmap -layout us

For the past a few months, I practiced using a different variant of dvorak. It is called programmer Dvorák. Actually it is pretty nice, since it saves time with all the special characters and such. So, to use this variant all you have to do is:

setxkbmap -layout us -variant dvp

Also, because I use vim all the time, I mapped the Caps Lock key to Escape. This makes it so much easier to use Esc without jumping all the way to the Esc key. To do that, you can create .xmodmap file in your home directory. Then copy the following in it.

1
2
clear Lock
keycode 0x42 = Escape

And this is all what you need to change the key mapping. Now, all you have to do is to put this into effect using xmodmap as follows:

xmodmap ~/.xmodmap

happy coding :) . Please, Share your thought !!

Leave a Reply

Get Adobe Flash playerPlugin by wpburn.com wordpress themes
top