LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-17-2015, 06:34 AM   #1
thelynx
Member
 
Registered: Jan 2015
Location: Thailand
Distribution: Fedora 33 / Endeavour OS / Deepin
Posts: 48

Rep: Reputation: Disabled
Cannot permanently switch to US keyboard layout


Hello

I'm running E19 on Sparky Linux (Debian 8) and just installed a new keyboard on my Lenovo T420. Before I had a UK keyboard, but now I have US keyboard. I've tried deleting the UK keyboard layout and adding the US keyboard under keyboard settings but that doesn't work, even though it shows the American keyboard as being active and the UK layout isn't there at all. The output of my /etc/default/keyboard is

Code:
# KEYBOARD CONFIGURATION FILE

# Consult the keyboard(5) manual page.

XKBMODEL="pc105"
XKBLAYOUT="us"
XKBVARIANT=""
XKBOPTIONS=""

BACKSPACE="guess"
So that shows US, too. The only way I can get the US layout is by manually typing
Code:
 setxkbmap -us
in the terminal. I don't really feel like doing that every time I log in.

If anyone can tell me what I'm overlooking here and how I can solve this problem, I'd be most grateful.

Thanks in advance.
 
Old 07-17-2015, 07:36 AM   #2
fatmac
LQ Guru
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: Mainly Devuan, antiX, & Void, with Tiny Core, Fatdog, & BSD thrown in.
Posts: 5,487

Rep: Reputation: Disabled
Well if you can't find any other way, just add setxkbmap us to your shell config file.
 
Old 07-18-2015, 11:23 AM   #3
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
# dpkg-reconfigure keyboard-configuration

Just like you do for a raspberry pi.
 
Old 07-19-2015, 11:37 PM   #4
thelynx
Member
 
Registered: Jan 2015
Location: Thailand
Distribution: Fedora 33 / Endeavour OS / Deepin
Posts: 48

Original Poster
Rep: Reputation: Disabled
Shadow 7: I tried what you suggested but to no effect. It's still British.

fatmac: When you say the shell config file, do you mean .bash_profile, .bashrc or somewhere else? And where exactly in the file would I put it?

Many thanks.
 
Old 07-20-2015, 03:16 AM   #5
fatmac
LQ Guru
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: Mainly Devuan, antiX, & Void, with Tiny Core, Fatdog, & BSD thrown in.
Posts: 5,487

Rep: Reputation: Disabled
Actually it would go in .xinitrc, (towards the end).

(May or may not need a & after it.)
 
Old 07-20-2015, 05:54 AM   #6
thelynx
Member
 
Registered: Jan 2015
Location: Thailand
Distribution: Fedora 33 / Endeavour OS / Deepin
Posts: 48

Original Poster
Rep: Reputation: Disabled
fatmac,

I don't have the file .xinitrc. I know it's a hidden file, but I don't have it. I have a ~/.profile. Could I put it there?

Thanks
 
Old 07-20-2015, 06:25 AM   #7
cynwulf
Senior Member
 
Registered: Apr 2005
Posts: 2,727

Rep: Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367
You're not being specific as to where the keyboard layout is not working as expected. /etc/default/keyboard is, as I recall, system wide configuration but does not apply to X. So after making those changes, you should get the US keyboard layout in VTs, but not while in X?

keyboard-configuration may also not affect X (can't remember). Most likely your system locale is set to UK and I believe X tries to autoconfigure its keybaord layout based on that and not the keyboard layout in use by the system.

This should work in your ~/.xinitrc
Code:
setxkbmap -layout us
(if it doesn't exist, create it)

Failing that put it in ~/.xsession

If none of that works for whatever reason, creating/modifying an xorg config file and specifying the layout you want to use should work.
 
Old 07-20-2015, 06:43 AM   #8
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
To see what the system thinks you're using. And what some parameters are as options passed to configuration tools.

$ setxkbmap -print -verbose 10

$ localectl list-x11-keymap-models
$ localectl list-x11-keymap-layouts
$ localectl list-x11-keymap-variants us
$ localectl list-x11-keymap-options

Mostly from the arch wiki. I'm not really sure how to set it outside of the package management system. Although setxkbmap seems to have some effect on my jessie install. But you're obviously overriding system defaults "somewhere". Is something in /etc/X11/xkb/ ? Perhaps remove or move it and see if things change. You'll probably need to restart X to have it take.

Is this a system that you've had a while and upgraded to jessie / debian 8? Problems like this normally go away if you do a fresh install. Various other information about keyboards is found in /usr/share/X11/xkb/*, although that doesn't "set" the keyboard. You can probably set the keyboard in the display manager and/or window manager, depending on what you use. Elightenment is obviously one of those.
 
Old 07-20-2015, 07:05 AM   #9
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
I wonder that if you create a new user, if that user has the layout that you want and set with the package management system? If it does then there's something in your ~/.* files that is in the way. If it doesn't, then there's likely something in /etc/* that's in the way.
 
Old 07-23-2015, 01:53 AM   #10
thelynx
Member
 
Registered: Jan 2015
Location: Thailand
Distribution: Fedora 33 / Endeavour OS / Deepin
Posts: 48

Original Poster
Rep: Reputation: Disabled
Sorry for the very late reply. Thank you all for your assistance. In the end, I followed cynwulf's instructions and that solved the problem.

Cheers.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Switch keyboard layout nyuwa43 Linux - Laptop and Netbook 9 11-17-2014 09:35 PM
Switching the keyboard layout on window switch Lixt Linux - Software 8 09-18-2014 10:37 AM
Switch keyboard layout (works only one direction) krisyok Linux - Newbie 4 05-02-2007 06:12 AM
How do i switch keyboard layout in Gnome? z-vet Linux - Newbie 1 10-15-2004 05:02 AM
How to switch keyboard layout in KDE/RedHat 7.2 Bogdan Linux - Newbie 2 12-20-2001 01:01 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration