Arch Linux remapping keys

5,920

I am using this in my ~/.Xmodmap:

! who needs CapsLock anyway
clear Lock
keycode 66 = Escape

It only disables CapsLock so basically [CapsLock] and [Esc] act the same way on my system.

I also have following line in ~/.xinitrc to load my customized keyboard map whenever X starts.

if [ -s ~/.Xmodmap ]; then
    xmodmap ~/.Xmodmap
fi

You will find more solutions on the arch-forum.

The following solutions are just copied from the above link for reference.

This should be put in ~/.Xmodmap to switch both Keys. You also have to load your modified .Xmodmap file from .xinitrc.

remove Lock = Caps_Lock
add Lock = Escape
keysym Caps_Lock = Escape
keysym Escape = Caps_Lock

Or if you prefer another program instead of xmodmap, add following line to ~/.xinitrc:

setxkbmap -option caps:escape
Share:
5,920

Related videos on Youtube

user339365
Author by

user339365

Updated on September 18, 2022

Comments

  • user339365
    user339365 almost 2 years

    I was interested in installing Arch (or more specifically archbang) but could not figure out how to remap CAPSLOCK to ESC.

    I tried loadkeys, but it had an error: could not get a file descriptor referring to the console

    I'm used to using GNOME, where it is as easy as going into a menu and switching them. How do I do this on Arch?

    • prasanthv
      prasanthv over 3 years
      Yeah I think using the xmodmap utility approach is what you're looking for, though there are plenty of search results that crop with with loadkeys. I think xmodmap is more appropriate for your use-case -- as it's a utility for modifying keymaps vs. customizing keyboard for locale.