You are not logged in.

#1 2023-01-05 15:43:06

Jiozza
Member
Registered: 2023-01-04
Posts: 6

[SOLVED] Can't change keyboard layout from en_US to it_IT

I've been using Manjaro for a while and now I'm starting to use Arch for various reasons.

Since I wanted to install it in a streamlined way, I followed both the archwiki guide and the script here, a fork I modified, which is working as intended, except for one problem.

I have read the rules that I should ask them for help and not here on the arch forum, but I think the problem it's not in the script but something related to arch.

The script use these commands:

sed -i 's/^#it_IT.UTF-8 UTF-8/it_IT.UTF-8 UTF-8/' /etc/locale.gen
locale-gen
timedatectl --no-ask-password set-timezone ${TIMEZONE}
timedatectl --no-ask-password set-ntp 1
localectl --no-ask-password set-locale LANG="it_IT.UTF-8" LC_TIME="it_IT.UTF-8"
ln -s /usr/share/zoneinfo/${TIMEZONE} /etc/localtime

# Set keymaps
localectl --no-ask-password set-keymap ${KEYMAP}

echo '
LANG=it_IT.UTF-8' | tee --append /etc/locale.conf

After the installation I log in and the keyboard layout is en_US.
Even if I follow the guide on the wiki, changing every file as told, I still can't type with the italian layout but I have to use the US keyboard.
This is my locale now, but it still use the US layout.

locale


I noticed that if i change to tty2 with ctrl+alt+F2 and login as my user, I can use

sudo loadkeys it

to change layout and in tty2 works as intended.

I thought the problem might be KDE but i tried another desktop enviroment and it's the same.
Another thing I thought it might create problem was ZSH but i didn't find anything that might cause a problem.

The layout it's wrong on everything: browser, notes, etc. not only the terminal.

I checked with

 ls /usr/share/kbd/keymaps/**/*.map.gz 

to see if there was an it keymap but there isn't, might it be the problem? How can I add it?

I'm currently using Arch in a virtual machine under windows, since it's easier and faster to debug problems without dualbooting, but the problem is present even if I dual boot.

Have I missed something?

Thanks for the help

Last edited by Jiozza (2023-01-05 21:19:18)

Offline

#2 2023-01-05 16:03:39

Jiozza
Member
Registered: 2023-01-04
Posts: 6

Re: [SOLVED] Can't change keyboard layout from en_US to it_IT

This is my locale now, but it still use the US layout.

I have wrote something wrong and it didn't load, this is the correct one:

LANG=it_IT.UTF-8
LC_CTYPE="it_IT.UTF-8"
LC_NUMERIC="it_IT.UTF-8"
LC_TIME="it_IT.UTF-8"
LC_COLLATE="it_IT.UTF-8"
LC_MONETARY="it_IT.UTF-8"
LC_MESSAGES="it_IT.UTF-8"
LC_PAPER="it_IT.UTF-8"
LC_NAME="it_IT.UTF-8"
LC_ADDRESS="it_IT.UTF-8"
LC_TELEPHONE="it_IT.UTF-8"
LC_MEASUREMENT="it_IT.UTF-8"
LC_IDENTIFICATION="it_IT.UTF-8"
LC_ALL=

Offline

#3 2023-01-05 16:07:17

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,411

Re: [SOLVED] Can't change keyboard layout from en_US to it_IT

I have read the rules that I should ask them for help and not here on the arch forum, but I …

… chose to just ignore that.
Of course the problem is with the script.
Check the output of

localectl

and read https://wiki.archlinux.org/title/Linux_ … figuration and https://wiki.archlinux.org/title/Xorg/K … figuration

I checked with ls /usr/share/kbd/keymaps/**/*.map.gz to see if there was an it keymap but there isn't

ls /usr/share/kbd/keymaps/i386/qwerty/it*
pacman -Qikk kbd

Have I missed something?

https://wiki.archlinux.org/title/Installation_guide
https://bbs.archlinux.org/misc.php?action=rules

Edit: the locale variables define the *output* (for i18n'd programs), not the keyboard layout.

Last edited by seth (2023-01-05 16:08:06)

Offline

#4 2023-01-05 16:07:40

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: [SOLVED] Can't change keyboard layout from en_US to it_IT

Jiozza wrote:

I think the problem it's not in the script but something related to arch

So do you still experience this problem if you follow the official guide? Those scripts look crap, I wouldn't bother with those at all. Have you tried archinstall?

EDIT: ninja'd again big_smile

Last edited by Head_on_a_Stick (2023-01-05 16:08:25)


Jin, Jîyan, Azadî

Offline

#5 2023-01-05 16:28:25

Jiozza
Member
Registered: 2023-01-04
Posts: 6

Re: [SOLVED] Can't change keyboard layout from en_US to it_IT

seth wrote:

I have read the rules that I should ask them for help and not here on the arch forum, but I …

… chose to just ignore that.
Of course the problem is with the script.
Check the output of

localectl

and read https://wiki.archlinux.org/title/Linux_ … figuration and https://wiki.archlinux.org/title/Xorg/K … figuration

I checked with ls /usr/share/kbd/keymaps/**/*.map.gz to see if there was an it keymap but there isn't

ls /usr/share/kbd/keymaps/i386/qwerty/it*
pacman -Qikk kbd

Have I missed something?

https://wiki.archlinux.org/title/Installation_guide
https://bbs.archlinux.org/misc.php?action=rules

Edit: the locale variables define the *output* (for i18n'd programs), not the keyboard layout.

You're right, but since no one else with the script had a problem, I thought it might be a problem with the Italian Layout.


[jiozza@archjiozza ~]$ localectl
System Locale: LANG=it_IT.UTF-8
    VC Keymap: it2    
   X11 Layout: it

I followed https://wiki.archlinux.org/title/Xorg/K … figuration but it's of no use.
I'm trying to use wayland so it might be the problem.

Since I doesn't follow the rules of the forum, I'll delete this post in the next hours


Head_on_a_Stick wrote:

So do you still experience this problem if you follow the official guide? Those scripts look crap, I wouldn't bother with those at all. Have you tried archinstall?

I tried with the official guide and I have no problems, but as said before, on console there are no problems.

I didn't know about archinstall, I'm using this script just as a fun project since to improve my "know-how" on linux + github.

Offline

#6 2023-01-05 16:46:22

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: [SOLVED] Can't change keyboard layout from en_US to it_IT

Jiozza wrote:
[jiozza@archjiozza ~]$ localectl
System Locale: LANG=it_IT.UTF-8
    VC Keymap: it2    
   X11 Layout: it

I followed https://wiki.archlinux.org/title/Xorg/K … figuration but it's of no use.
I'm trying to use wayland so it might be the problem.

Under Wayland keyboard configuration is handled by the compositor. Which Wayland desktop are you using?

For example, here's my keyboard configuration for sway:

# ~/.config/sway/config
# You can get the names of your inputs by running: swaymsg -t get_inputs
# Read `man 5 sway-input` for more information about this section.
   input "1:1:AT_Translated_Set_2_keyboard" xkb_layout gb

Jin, Jîyan, Azadî

Offline

#7 2023-01-05 16:49:48

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,411

Re: [SOLVED] Can't change keyboard layout from en_US to it_IT

Please don't mindlessly full-quote stuff.
You're not deleting anything, but once a mod sees it, it goes to the dustbin.

it's of no use

… "to you"

You've configured the "it2" keymap for the console and "it" for X11

it2 wrote:

!  Note:
!       Since the Italian keyboard lacks of some basic keys ( like the '{}'
!       parentheses  and the '`' grave ) and the most used keys like the
!       unix slash '/' are in the wrong position, I added some new keys
!       binding to the standard Italian keyboard. They are:
!       CHARACTER               KEY
!           `                   AltGr-<'>
!           /                   <->
!           -                   AltGr-<->       
!           {                   AltGr-<8>
!           }                   AltGr-<9>
!           ~                   AltGr-<\>

In what context do you try to use that layout and what layout do you get instead?

I noticed that if i change to tty2 with ctrl+alt+F2 and login as my user, I can use

sudo loadkeys it
to change layout and in tty2 works as intended.

would suggest that you've simply picked the wrong console layout. Or the shitty script did.
I don't care.

Offline

#8 2023-01-05 18:19:18

Jiozza
Member
Registered: 2023-01-04
Posts: 6

Re: [SOLVED] Can't change keyboard layout from en_US to it_IT

Under Wayland keyboard configuration is handled by the compositor. Which Wayland desktop are you using?

Kwin/Plasma https://wiki.archlinux.org/title/KDE#Starting_Plasma

You've configured the "it2" keymap for the console and "it" for X11

For italian everyone use it since i can use { } and the other stuff (I don't know why it2 is necessary), i tried it2 as well but both don't work in wayland.

In what context do you try to use that layout and what layout do you get instead?

In every single program, terminal, browser in KDE en_US is the layout.

Now I create a new VM and let everything to en_US. Following the guide on the wiki I changed again the layout and looks like it's in italian now after a reboot.
I think I will try to use Xorg and not wayland for now. Changing to it from wayland resolve the problem so for now it will do.

Just to clarify, I'm not asking help about the script, I'm asking help about why a working arch installation doesn't let me change the layout.

Offline

#9 2023-01-05 18:24:33

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: [SOLVED] Can't change keyboard layout from en_US to it_IT

Jiozza wrote:

Kwin/Plasma

So did you try the keyboard configuration GUI for that desktop?


Jin, Jîyan, Azadî

Offline

#10 2023-01-05 21:17:41

Jiozza
Member
Registered: 2023-01-04
Posts: 6

Re: [SOLVED] Can't change keyboard layout from en_US to it_IT

So did you try the keyboard configuration GUI for that desktop?

Actually I didn't.
That solved the problem both for X11 and Wayland... It's strange to me that it didn't work via terminal, but ok.

Thank you for youre help.

Offline

#11 2023-01-05 21:33:14

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,411

Re: [SOLVED] Can't change keyboard layout from en_US to it_IT

The wayland compositors are kinda expected to parse and use 00-keyboard.conf, but even if KDE does, if there's a local (KDE specific) keyboard layout configured for your user (for whatever reason), that would reasonably override the global setting.

Offline

Board footer

Powered by FluxBB