Can't change keymap for TTY4

My keyboard is a french one and I need some specials characters to type my password that I do not find on the keymap that is already loaded on the tty4.
I tried various things to change it but it didn’t work.

loadkeys fr returns “Couldn’t get a file descriptor referring to the console.”

Here is my /etc/vconsole.conf :

KEYMAP=fr
FONT=
FONT_MAP=

Here is my locale :

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

Thanks a lot

Hi @Anyone, and welcome!

I suspect this will help: Locale - Manjaro

Hope you get sorted!

Thanks, I tried to change the three that were set to en_US.UTF-8 with sudo localectl set-locale. The command runs well and when I do echo $status or echo $? it returns to me 0, but nothing has changed in locale.

I’d say try a reboot and see if that works.

I myself use a non-default locale, and I know people on the forum as well, so it work. So it might just require a restart.

Hello, just for comparison, here is my locale:

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

I rebooted, and my locale did change :

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

But the keymap in the tty4 still hasn’t changed…

Should I change LANG as well ? I would like to keep my device’s language in english, but with the changes I already did, Manjaro is now in french.

I think it is about the keymap, not about the language as such …
Since I had a similar issue due to wrong keymap and needing to type a password to decrypt my encrypted installation
my guess is to adjust
/etc/vconsole.conf
and put:
KEYMAP=fr
there

Mine looks like this:

KEYMAP=de
FONT=ter-i16n

and I have the german keymap right from the get go, everywhere.

Possibly - I did that because it needed to work in the initrd as well - you need to add the “keymap” HOOK to /etc/mkinitcpio.conf

Worth trying? :wink:

edit:
sudo loadkeys fr should also have that effect
but you only can type that command after you already logged in … so it probably isn’t very useful :wink:

Edit:
ok, this is embarrassing
I just re-read your initial post and saw that you already have:

KEYMAP=fr

there.
So: what I wrote here is totally redundant and unhelpful.

Sorry!

OK, honestly, I don’t know 'bout that.

If you would like to keep everything except TTY4 in English, then change it back, as the TTY is obviously the exception.


I’m completely unsure about this, but maybe set terminal command to change the locale/keyboard layout by Command line for a specific TTY? I believe you should theoretically, be able to do by creating a file in /usr/local/bin with a simple if statement. In pseudo-code:

if [[ $TTY -eq 'tty4' ]];
then
   change_keymap();
fi

Or something of the sort.

Edit:
Also look into combining it with @Nachlese’s answer. That might be it, I don’t know.

Thanks anyway :smiley:

Sorry, maybe not only for the TTY4 specifically. But just in order to be able to type my password

… maybe try what I suggested anyway?

Have just the KEYMAP=fr in there,
and remove/comment out the other two lines
which have keywords, but are empty,
like this (for example)

and proceed to add the “keymap” HOOK to /etc/mkinitcpio.conf

I have the “keyboard” and the “keymap” HOOKs in there.

regenerate the initrd and see whether that does the trick

… it sure does work for me :wink:

My HOOKS line in /etc/mkinitcpio.conf looks like this:

HOOKS=(base udev autodetect modconf block keyboard keymap consolefont encrypt fsck filesystems resume)

perhaps that helps

edit:
addition:
there are a few different french keymaps

fr
fr-bepo
fr-bepo-latin9
fr-latin1
fr-latin9
fr-pc
fr_CH
fr_CH-latin1

perhaps just putting “fr” is not choosing the correct one?

this list of keymaps can be seen with:
localectl list-keymaps

Sorry for the delay,
So, I tried to comment the lines in vconsole.conf, but it doesn’t seem to work…

I also have this in my HOOKS line in /etc/mkinicpio.conf :

HOOKS="base udev autodetect modconf block keyboard keymap filesystems"

I don’t think that the fr keymap is wrong because I use it everywhere else (or so I think) and it works

… but isn’t this about exactly that?
The keymap obviously not working on TTY?
By that I mean: the character that gets posted on the screen does not match the character that you press on your keyboard.

In any case: I have no other ideas
as /etc/vcondole.conf is the only place I know of where the console keymap is set.

Okay, well thanks anyway for trying to help me ! :grinning_face_with_smiling_eyes: