You are not logged in.

#1 2023-12-09 15:14:22

light9876
Member
Registered: 2020-01-05
Posts: 142

[SOLVED] Switching keyboard to Arabic keyboard inaccurate

I use the following command to switch between English and Arabic keyboards:

localectl --no-convert set-x11-keymap gb,ara pc105, qwerty_digits grp:caps_toggle

Seth previously helped me achieve this command here https://bbs.archlinux.org/viewtopic.php?id=289748

The problem is that the Arabic keyboard types numbers 12345 whereas I need them to be ١٢٣٤٥

I can achieve this if I run the command:

setxkbmap ara qwerty_digits

How can I fix the localectl command please?

Results after running the localectl command:

$setxkbmap -print -query
xkb_keymap {
        xkb_keycodes  { include "evdev+aliases(qwerty)" };
        xkb_types     { include "complete"      };
        xkb_compat    { include "complete"      };
        xkb_symbols   { include "pc+gb+ara:2+inet(evdev)+group(caps_toggle)"    };
        xkb_geometry  { include "pc(pc104)"     };
};
rules:      evdev
model:      pc105,
layout:     gb,ara
variant:    qwerty_digits
options:    grp:caps_toggle
$ cat /etc/X11/xorg.conf.d/00-keyboard.conf
# Written by systemd-localed(8), read by systemd-localed and Xorg. It's
# probably wise not to edit this file manually. Use localectl(1) to
# instruct systemd-localed to update it.
Section "InputClass"
        Identifier "system-keyboard"
        MatchIsKeyboard "on"
        Option "XkbLayout" "gb,ara"
        Option "XkbModel" "pc105,"
        Option "XkbVariant" "qwerty_digits"
        Option "XkbOptions" "grp:caps_toggle"
EndSection

Last edited by light9876 (2023-12-10 16:32:21)

Offline

#2 2023-12-09 16:52:38

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

Re: [SOLVED] Switching keyboard to Arabic keyboard inaccurate

You're applying the variant to the wrong layout, try

Option "XkbVariant" ",qwerty_digits"

The problem is that the Arabic keyboard types numbers 12345 whereas I need them to be ١٢٣٤٥

You know that the rest of the world calls "12345" arabian digits (instead of the less-great scaling roman system I II III IV V ?)
tongue

Offline

#3 2023-12-09 23:13:04

light9876
Member
Registered: 2020-01-05
Posts: 142

Re: [SOLVED] Switching keyboard to Arabic keyboard inaccurate

Thanks very much Seth.

I think I should call them eastern numbers ١٢٣٤٥ as opposed to western 12345

I remember a couple of years ago the same command worked just fine with eastern numbers (you were also the one who helped me at that time as well):
https://bbs.archlinux.org/viewtopic.php … 6#p2005906

But it seems like it stopped working due to an update or something else..

Is there a way to do it directly from the localectl command, without having to edit any files manually?

Offline

#4 2023-12-09 23:32:24

teckk
Member
Registered: 2013-02-21
Posts: 585

Re: [SOLVED] Switching keyboard to Arabic keyboard inaccurate

12345 are arabic numbers.

Mashriki numbers
٠, ١, ٢, ٣, ٤, ٥, ٦, ٧, ٨, ٩

https://en.m.wikipedia.org/wiki/Eastern_Arabic_numerals

Offline

#5 2023-12-10 01:18:09

light9876
Member
Registered: 2020-01-05
Posts: 142

Re: [SOLVED] Switching keyboard to Arabic keyboard inaccurate

Yes, mashriki means "eastern". So this is what I want, mashriki..

Offline

#6 2023-12-10 09:01:53

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

Re: [SOLVED] Switching keyboard to Arabic keyboard inaccurate

s there a way to do it directly from the localectl command, without having to edit any files manually?
You put the comma there:

localectl --no-convert set-x11-keymap gb,ara pc105, ,qwerty_digits grp:caps_toggle

Offline

#7 2023-12-10 12:20:30

light9876
Member
Registered: 2020-01-05
Posts: 142

Re: [SOLVED] Switching keyboard to Arabic keyboard inaccurate

seth wrote:
localectl --no-convert set-x11-keymap gb,ara pc105, ,qwerty_digits grp:caps_toggle
Failed to set keymap: Specified keymap cannot be compiled, refusing as invalid.

Update:
Even after updating the file /etc/X11/xorg.conf.d/00-keyboard.conf manually:

# Written by systemd-localed(8), read by systemd-localed and Xorg. It's
# probably wise not to edit this file manually. Use localectl(1) to
# instruct systemd-localed to update it.
Section "InputClass"
        Identifier "system-keyboard"
        MatchIsKeyboard "on"
        Option "XkbLayout" "gb,ara"
        Option "XkbModel" "pc105,"
        Option "XkbVariant" ",qwerty_digits"
        Option "XkbOptions" "grp:caps_toggle"
EndSection

Keyboard switching breaks altogether.

Last edited by light9876 (2023-12-10 13:05:22)

Offline

#8 2023-12-10 13:09:09

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

Re: [SOLVED] Switching keyboard to Arabic keyboard inaccurate

Try to quote things, 

localectl --no-convert set-x11-keymap "gb,ara" "pc105," ",qwerty_digits" "grp:caps_toggle"

or try

localectl --no-convert set-x11-keymap "gb,ara" "pc105," "basic,qwerty_digits" "grp:caps_toggle"

… or just edit the file, localectl quite frankly is not very good.

Edit: what's the resulting impact on "setxkbmap -print -query"?

Last edited by seth (2023-12-10 13:10:07)

Offline

#9 2023-12-10 16:31:58

light9876
Member
Registered: 2020-01-05
Posts: 142

Re: [SOLVED] Switching keyboard to Arabic keyboard inaccurate

Thanks Seth. It turned out that sometime in the past two years the arabic keyboard variant was renamed!!!!! from 'qwerty_digits' to 'digits' only

The following command worked:

localectl --no-convert set-x11-keymap gb,ara pc105 ,digits grp:caps_toggle

This is not the first time that you help me. Thanks very much.

Offline

Board footer

Powered by FluxBB