CentOS 7 + KDE – Default Keyboard Layout?

Home » CentOS » CentOS 7 + KDE – Default Keyboard Layout?
CentOS 6 Comments

Hi,

I’m currently fiddling with CentOS 7 and KDE 4.14, and I must say, I’m pleasantly surprised. This is one of the cleanest implementations of KDE
I’ve ever seen, and with some tweaking (a lot, in fact) this can be turned into a highly functional desktop with all the bling and bells and whistles.

But right now, I have some minor problems to solve. First things first. My system is installed in French, with a swiss french keyboard
(fr_CH-latin1) as default. This works OK in console mode, but when KDE
launches the first time, the default keyboard is US, and there’s a french (fr-latin1) alternative configured.

In my humble opinion, this looks like a minor bug, because the default keyboard should be the same as the one defined in the installer. Now I
know this can be changed easily, but I’m planning to use this in a few production environments like our local school. Which would mean I have to log into every single account to switch the keyboard layout manually.

Now I wonder if this can’t be done by the way of a profile in /etc/skel. I’ve already created a custom user profile for my users, to be put in
/etc/skel. I have a little script that puts all these in the right place:

https://github.com/kikinovak/CentOS/tree/master/el7/kde

If I create a few custom keyboard layouts in KDE (say french, swiss french and german), are these stored somewhere locally in ~/.kde/share?
I searched around a bit, but couldn’t find the place.

Any suggestions?

Niki


Microlinux – Solutions informatiques durables
7, place de l’église – 30730 Montpezat Web : http://www.microlinux.fr Mail : info@microlinux.fr Tél. : 04 66 63 10 32

6 thoughts on - CentOS 7 + KDE – Default Keyboard Layout?

  • XFCE user here, so I’m not sure if KDE tries to enforce its own settings with regard to the keyboard layout, but have you tried (as root):

    localectl set-x11-keymap pc105 nodeadkey

    This changes the X11 keyboard settings permanently for all users on the system and works fine with (at least) XFCE.

    Patrick

  • Interesting, I didn’t actually realize that myself before.

    According to this link

    https://wiki.manjaro.org/index.php?title=Configuration_du_clavier_apr%C3%A8s_l%27installation

    the XkbLayout should read “ch(fr)” instead of “fr_CH-latin1”, as the system console and X.org seem to use a different notation for selecting the layout in this particular case:

    – Dans le terminal – Pour la Suisse romande:
    loadkeys fr_CH-latin1

    – Dans X11 / Xorg – Configurer le clavier de manière permanente:
    Option “XkbLayout” “ch(fr)”

    Then, this should work as well:

    localectl set-x11-keymap ‘ch(fr)’ pc105 nodeadkey

    That could be possible, of course. On FreeBSD, with the keyboard layout configured the old-fashioned way via /etc/X11/xorg.conf, KDE does respect the system-wide settings. I would expect KDE to behave the same on CentOS. However, I only had to deal with easy layouts like “de” and “us” so far;
    Swiss-French might pose a bit more of a challenge. ;-)

    Patrick


    If you’d like to send me a private message, make sure to remove the “_lists” part from my address.

  • Le 14/11/2016 à 17:33, Patrick Hess a écrit :

    I’m running Slackware on my main workstation, where I have a
    90-keyboard-layout.conf file in /etc/X11/xorg.conf.d, and it looks like this:

    Section “InputClass”
    Identifier “keyboard-all”
    MatchIsKeyboard “on”
    MatchDevicePath “/dev/input/event*”
    Driver “evdev”
    Option “XkbLayout” “ch”
    Option “XkbVariant” “fr”
    Option “XkbOptions” “terminate:ctrl_alt_bksp”
    EndSection

    But then, I’m also running Xfce on this machine, so I don’t know if on the CentOS machine, the problem is related to localectl, to X.org or to KDE.

    I tried to replace the CentOS configuration stub with the one I have on the Slackware machine, but to no avail. The keyboard is still US. While it’s not a big deal, of course, I’d rather avoid having to reconfigure all my users’ keyboard layout by hand.

    Cheers,

    Niki


    Microlinux – Solutions informatiques durables
    7, place de l’église – 30730 Montpezat Web : http://www.microlinux.fr Mail : info@microlinux.fr Tél. : 04 66 63 10 32

  • Alright, I just installed KDE in an existing VirtualBox VM (so that I
    can easily undo everything later) that used to be “fully Germanized”, and then tried to switch the whole system over to French:

    virtualCentOS7:~ > localectl
    System Locale: LANG=fr_FR.UTF-8
    VC Keymap: fr-nodeadkeys
    X11 Layout: fr
    X11 Model: pc105
    X11 Variant: nodeadkeys
    virtualCentOS7:~ > getafrencherrormessage
    bash: getafrencherrormessage : commande introuvable

    So far, so good. Here’s where the fun begins… XFCE talks to me in French, whereas KDE still insists on speaking English (there’s probably a separate package that needs to be installed, but who cares). What’s more important, the keyboard layout in GDM, XFCE and KDE is still *German*! In fact, even GDM still offers only German and US layouts to choose from.

    Honestly, I have no clue what’s going on here anymore. I surely must be missing something.

    Well, there’s always “setxkbmap ‘ch(fr)'” that you could run automatically when a user logs in. And this *does* actually work here, e.g. pressing the
    Ö key on my German keyboard causes an é to appear, which should correspond to a Swiss-French layout. I’m not entirely sure what the best place to put this command would be, though. Maybe /etc/profile or ~/.profile?

    test -n “$DISPLAY” && setxkbmap ‘ch(fr)’

    After all, this doesn’t look like a KDE issue to me. Let’s blame systemd, shall we? ;-)

    Patrick


    If you’d like to send me a private message, make sure to remove the “_lists” part from my address.