Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 26th November 2011, 11:53 AM
Adunaic's Avatar
Adunaic Online
Registered User
 
Join Date: Mar 2009
Location: Lancaster, UK
Posts: 886
linuxfirefox
Change keyboard layout and remap key.

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 ).
Reply With Quote
  #2  
Old 26th November 2011, 08:33 PM
synic Offline
Registered User
 
Join Date: Mar 2005
Location: Brisbane, Australia
Age: 41
Posts: 254
linuxopera
Re: Change keyboard layout and have it applied 100% systemwide.

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.

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?
__________________
Discourse and Diatribe
Reply With Quote
  #3  
Old 26th November 2011, 09:43 PM
Mariusz W Offline
Registered User
 
Join Date: Nov 2007
Location: Berkeley, California
Posts: 690
unknownunknown
Re: Change keyboard layout and remap key.

Quote:
Originally Posted by Adunaic View Post
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 ----------

Quote:
Originally Posted by synic View Post
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.

Quote:
Originally Posted by synic View Post
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

Last edited by Mariusz W; 26th November 2011 at 10:02 PM.
Reply With Quote
  #4  
Old 27th November 2011, 10:26 PM
synic Offline
Registered User
 
Join Date: Mar 2005
Location: Brisbane, Australia
Age: 41
Posts: 254
linuxopera
Re: Change keyboard layout and remap key.

Quote:
Originally Posted by Mariusz W View Post
I suppose you mean keymaps for use in applications that are X clients, not in Linux console.
...
I'm not actually sure what that means. Sorry. I mean that sometimes when boot, or login fails; prior to the login screen for either Gnome or KDE, you will be dropped at a command line which I believe is run level 3. You just have a bash prompt, sometime networking; but X isn't running ie: no pretty graphical user interface.

When this happens, and you just have a black screen and bash, the keyboard layout is always in Qwerty. I want it to default to Colemak; so that I can type properly when trouble shooting, and also so that when Gnome 3 fails and I get dropped back to the login screen, again, I can just type in Colemak ranther than having to single finger poke in order to get the keys right.

I have two keyboard layouts enabled in Gnome and just switch between the 2 with a hotkey that my wife 'has now come to terms with and can use' (she uses Qwerty).

I'm KNOW it must be supported / possible, somehow.

I'm under the impression that if I run: grub2-mkconfig -o /boot/grub2/grub.cfg, the default keyboard layout is pulled from the settings in /etc/default/grub; and that is why my keytable is always in Keytable=us.

I am now running a fresh install because yesterday I hosed my system mucking around with the keytable settings in /etc/default/grub. And it didn't work, and, I'm actually not sure why.

Anyway, after stuffing around for about 2 hours and getting nowhere (because my VI skills arn't the best) I decided to just reinstall. Its a crappy way to go about because I know it should be relatively easy to fix.

Quote:
Originally Posted by Mariusz W View Post
...
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 ----------

When I ran setkbmap not a whole lot happened other than toggling between the Colemak and Qwerty us layouts I had already set.

Quote:
Originally Posted by Mariusz W View Post
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.
Do you know if this is fixed? (Sorry, I realise that is what we are getting to in the next point.)

Quote:
Originally Posted by Mariusz W View Post
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
I'm not sure of the exact layout to imput it as. The Arch Wiki lists the layout as: KEYMAP="colemak" Colemak (US) Interesting Colemak is the only layout not gz'ed.

Although I have a funny feeling that KEYMAP and KEYTABLE are different things. In fact, I assume they are.

Pointing me to /etc/sysconfig I believe is what I am looking for. And
[root@study sysconfig]# cat keyboard
KEYTABLE="us"
MODEL="pc105+inet"
LAYOUT="us"
is getting close; isn't it? I'm just not sure what format I should be changing KEYTABLE="us" to before I run:

Quote:
Originally Posted by Mariusz W View Post
Code:
grub2-mkconfig -o /boot/grub2/grub.cfg
I hope that Colemak is supported at all those levels, I would have selected Colemak during the install but it isn't an option offered by Fedora during install. That was one of the reasons I used the full 3.5 gig install disk rather than a 650M live disk. I was expecting the Colemak keyboard layout to be an option when doing a full install. I know it is an option offered by Ubuntu. Interesting

Where can I find the required KEYTABLE="colemak" format that will be accepted by grub2-mkconig when updating my boot parameter? And where will I change it? Is it /etc/sysconfig/keyboard?

Thank you very much...
__________________
Discourse and Diatribe

Last edited by synic; 27th November 2011 at 10:29 PM.
Reply With Quote
  #5  
Old 27th November 2011, 11:34 PM
Mariusz W Offline
Registered User
 
Join Date: Nov 2007
Location: Berkeley, California
Posts: 690
macosmidori
Re: Change keyboard layout and remap key.

Quote:
Originally Posted by synic View Post
I'm not sure of the exact layout to imput it as. The Arch Wiki lists the layout as: KEYMAP="colemak" Colemak (US)

Interesting Colemak is the only layout not gz'ed.
I am not sure what do you mean by that: /lib/kbd/keymaps/i386/colemak is a directory, /lib/kbd/keymaps/i386/qwerty is another directory -- gzipped files in such directories correspond to layouts. There are plenty of those in the qwerty directory and just one in the colemak directory.

Quote:
Originally Posted by synic View Post
Although I have a funny feeling that KEYMAP and KEYTABLE are different things. In fact, I assume they are.
Be warned that certain things Arch Linux does differently from Fedora, especially setting various options during boot time.

Quote:
Originally Posted by synic View Post
Pointing me to /etc/sysconfig I believe is what I am looking for. And
[root@study sysconfig]# cat keyboard
KEYTABLE="us"
MODEL="pc105+inet"
LAYOUT="us"
is getting close; isn't it? I'm just not sure what format I should be changing KEYTABLE="us" to before I run: (...)
I would try first to change /etc/sysconfig/keyboard to
Code:
KEYTABLE="en-latin9"
MODEL="pc105+inet"
LAYOUT="en-latin9"
If this works, then
Code:
KEYTABLE="en-latin9"
MODEL="pc105+inet"
may work too.

Last edited by Mariusz W; 28th November 2011 at 12:27 AM.
Reply With Quote
  #6  
Old 27th November 2011, 11:37 PM
synic Offline
Registered User
 
Join Date: Mar 2005
Location: Brisbane, Australia
Age: 41
Posts: 254
linuxopera
Re: Change keyboard layout and remap key.

Sounds good. Here goes....

I've rebooted. Still here.

And should I change /etc/default/grub "KEYTABLE= " ??? " Or should I just leave that?
__________________
Discourse and Diatribe

Last edited by synic; 27th November 2011 at 11:42 PM.
Reply With Quote
  #7  
Old 28th November 2011, 12:09 AM
Mariusz W Offline
Registered User
 
Join Date: Nov 2007
Location: Berkeley, California
Posts: 690
macosmidori
Re: Change keyboard layout and remap key.

Quote:
Originally Posted by synic View Post
Sounds good. Here goes....

I've rebooted. Still here.
I was still editing my post when you have been rebooting, re-read my post.

Quote:
Originally Posted by synic View Post
And should I change /etc/default/grub "KEYTABLE= " ??? " Or should I just leave that?
I would change it to

Code:
KEYTABLE=en-latin9
and apply
Code:
grub2-mkconfig -o /boot/grub2/grub.cfg
afterwards.

I would like to add, however, that I am not sure whether doing this is advisable or not if you modified /etc/sysconfig/keyboard settings anyway. I verified that by leaving the old KEYTABLE=us flag in the GRUB configuration while replacing the contents of /etc/sysconfig/keyboard with what I wrote in my previous post:
Code:
KEYTABLE="en-latin9"
MODEL="pc105+inet"
already at the console login at the init 3 level I am presented with the changed keyboard layout that I presume is the Colmak layout. Since I have absolutely no familiarity with it I couldn't type in blind the password, so I had to reboot by pressing Ctrl-Alt-Del into init 1 in order to extricate myself from an awkward situation, and to revert to the previous /etc/sysconfig/keyboard that I saved, of course, as /etc/sysconfig/keyboard.bup.

Last edited by Mariusz W; 28th November 2011 at 02:09 AM.
Reply With Quote
Reply

Tags
change, keyboard, layout, remap

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
LXDE keyboard layout change ventsyv Using Fedora 1 24th September 2011 09:51 PM
[Solved] How to change the default keyboard layout? misiu_mp Using Fedora 0 6th December 2010 04:35 PM
Tsclient 2.0.1 change default keyboard layout xranix Using Fedora 0 23rd December 2008 01:59 PM
change keyboard layout stadin Hardware & Laptops 0 10th September 2007 01:47 AM
cannot change keyboard layout nocturnus_gr Using Fedora 0 30th September 2004 02:55 PM


Current GMT-time: 23:37 (Tuesday, 18-06-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat