
Originally Posted by
Adunaic
I cannot quite figure out how to change the keyboard layout to British English and to remap Cap Locks to be an additional Ctrl key.
I have done this through the GUI's but would like to know how to do this via the command line.
Also, I am approaching this from the point of view of a minimal install, so the less I need to install do to this the better.
As always though this is linux and there are many ways to do everything, so I luck forward to reading as many as possible (CLI only though

).
I suppose you mean keymaps for use in applications that are X clients, not in Linux console.
I'll give you two examples: first, a simple one. The following alias is in my ~/.bashrc to be used in desktop environments like fluxbox and Openbox:
Code:
alias ERP="setxkbmap -layout 'us,pl,ru' -variant 'altgr-intl,,phonetic' -option grp:alt_shift_toggle"
Executing it at the command line sets three keymaps in use: US International with combinations of AltGr and the accents serving as dead keys, Polish, and Russian (so called 'phonetic'; it is often referred as the 'yawerty' keymap, since pressing 'q' outputs Russian letter я ; this command also sets the combination Alt+Shift as the 'toggle' key: pressing it repeatedly cycles through the keymaps that are being selected.
Now, a more complex example:
Code:
alias ERP="setxkbmap -I$HOME/.xkb -layout 'us,pl_MW,ru_MW' -variant 'altgr-intl,,' -option grp:alt_shift_toggle -print | xkbcomp -I$HOME/.xkb - $DISPLAY 2>/dev/null"
It is an elaboration of the previous example with two keymaps being replaced by their modifications; I placed the latter in directory ~/.xkb/symbols.
I had to use a different syntax only due to essentially buggy nature of the sexkbmap command. This last command would by the way not work in CentOS 5.*, it has been working in Fedora 14, 15, and 16.
---------- Post added at 01:43 PM ---------- Previous post was at 01:15 PM ----------

Originally Posted by
synic
I'm also trying to figure out how to change the default (run level 3 & login screen keyboard layout.
Currently I use Colemak but this isn't set as default until it is applied AFTER logging into Gnome 3.
That's true. I complained about it soon after Fedora 16 had been released and Adam Williamson provided some information about this change from previous versions of the login screen.

Originally Posted by
synic
Does anyone know how to have your preferred keyboard layout set so that it apples at system / run level 3 / grub2 when you compile grub 2 / and the login screen?
Modify the corresponding fields in the /etc/sysconfig/etc/sysconfig file.
If, additionally, you want to change the Linux console font and the locale, then modify the corresponding fields in the /etc/sysconfig/i18 file. Finally, if you would like the font and the Linux console keymap (different from keymaps for X clients) to be changed already at boot, then modify the corresponding entries in the /etc/default/grub file and, subsequently, issue the command
Code:
grub2-mkconfig -o /boot/grub2/grub.cfg