On 8/23/19 11:01 AM, Pierre Labastie via blfs-support wrote:
On 23/08/2019 11:50, Christopher Gregory via blfs-support wrote:

Sent: Friday, August 23, 2019 at 9:05 PM
From: "Christopher Gregory via blfs-support" 
<[email protected]>
To: [email protected]
Cc: "Christopher Gregory" <[email protected]>
Subject: Re: [blfs-support] gdm: how to use a non us keyboard?



Sent: Friday, August 23, 2019 at 7:25 PM
From: "Pierre Labastie via blfs-support" 
<[email protected]>
To: [email protected]
Cc: "Pierre Labastie" <[email protected]>
Subject: Re: [blfs-support] gdm: how to use a non us keyboard?

On 23/08/2019 04:14, Christopher Gregory via blfs-support wrote:
Hello,

There is a thread from earlier this year that I found regarding gdm and non-us 
keyboards.  Though some of it is systemd related, the same files should be able 
to be modified for e-logind:

https://forums.nomachine.com/topic/wrong-keyboard-layout-during-login-in-ubuntu

The main fix seems to be at the last post, but even in that post the person who 
posted the solution refers to a post they made further up.

Regards,

Christopher.

Sent: Friday, August 23, 2019 at 10:14 AM
From: "Ken Moffat via blfs-support" <[email protected]>
To: "BLFS Support List" <[email protected]>
Cc: "Ken Moffat" <[email protected]>
Subject: Re: [blfs-support] gdm: how to use a non us keyboard?

On Thu, Aug 22, 2019 at 06:41:21PM +0200, Pierre Labastie via blfs-support 
wrote:
Hi,

I've completed the build of BLFS Sysv-elogind on LFS-9.0-rc1. Apart from what
I've already reported, things are going rather well, but I have a problem with
gdm: At first I thought it was not working, since I could not log in, while I
could "startx" gnome, or lxde without problem.

Then, I noticed that when "startx'ing" gnome, the keyboard was set to us,
while I have:
Section "InputClass"
         Identifier "libinput keyboard catchall"
         MatchIsKeyboard "on"
         MatchDevicePath "/dev/input/event*"
         Driver "libinput"
         Option "XkbLayout" "fr"
in /etc/X11/xorg.conf.d/40-libinput.conf

Inside gnome, I could add a keyboard using the settings manager, and switch to
the fr layout, but this made me think that the keyboard layout in gdm was
still us. So I typed my password as if I was on a us keyboard (well, not so
easy :), and bingo, gnome started...

So gdm is working, but I've not found any way to have it use a French kb 
layout...

I've tried adding "setxkbmap fr" at the end of /etc/gdm/Init/Default, but it
did not work.
So I do not know where to set this.

Note that American or British users are not likely to be affected :)

Pierre
Actually, British users will affected a little (but clearly not as
much as people with azerty or qwertz keyboards) - in Britain we have
'£' where americans have '#', we swap '"' and '@', and '#' + '~',
'|' + '\' move around (ISTR British '|' and '\' are on a key
position which American keymaps lack).

Good Luck with this, there are lots of old reports related to this,
but things may have changed in newer versions of gnome.  The Arch
wiki appears to suggest updating the Xorg configuration (or using
localectl for systemd) and restarting X (presumably a reboot if in
runlevel 5).

I notice you have done this in 40-libinput.conf as the catchall, in
my own builds I separate the keyboard definition to an earlier file.

The example at Arch for Xorg, linked from the gdm page
https://wiki.archlinux.org/index.php/GDM is
https://wiki.archlinux.org/index.php/Xorg/Keyboard_configuration#Using_X_configuration_files
with 00-keyboard.conf, so it gets read first, and uses
Identifier "system-keyboard" - I can't believe that the name
_ought_ to be important, but perhaps it is.

On the desktop where I'm writing this with a British keyboard I
have:

10-quirks.conf

Default modifications for specific pointing devices or a specific
accelerometer.

11-keyboard.conf

My own keyboard settings (two extended variant gb maps with compose
and group switching) - described as Identifier "keyboard-all" :

Section "InputClass"
         Identifier "keyboard-all"
         Driver "libinput"
         # for my own russian variant, specific to a gb keyboard, I put it in gb
         Option "XkbLayout" "gb,gb"
         # I assume that the model will remain as evdev
         Option "XkbModel" "evdev"
         # add my own 'deader' gb variant - more dead keys
         Option "XkbVariant" "deader,rusphon"
         Option "XkbOptions" 
"ctrl_alt_bksp,grp:lctrl_lwin_rctrl_menu,compose:caps"
         MatchIsKeyboard "on"
EndSection

40-libinput.conf

which includes

Section "InputClass"
         Identifier "libinput keyboard catchall"
         MatchIsKeyboard "on"
         MatchDevicePath "/dev/input/event*"
         Driver "libinput"
EndSection

All I can suggest is to move the keyboard definitions to an earlier
file and restart X (which probably means rebooting from runlevel 5).

Ah, I continued looking for anything which might be relevant (rather
than the more common unsolved, or solved by an upgrade, results) and
found an old (January 2015) comment in a mageia thread

https://bugs.mageia.org/show_bug.cgi?id=14476 (Comment 23) :

| The installer should (AFAIK) write the correct vconsole.conf file,
| but it might not add a dropin file (that systemd manipulates) into
| /etc/X11/xorg.conf.d/00-keyboard.conf (which is a file manipulated
| by localed to provide the systemd services).

And, of course, gdm assumes systemd will be running.
So, 00-keyboard.conf might be required.

ĸen
--
Adopted by dwarfs, brought up by dwarfs.  To dwarfs I'm a dwarf, sir.
I can do the rite of k'zakra, I know the secrets of h'ragna, I can
ha'lk my g'rakha correctly ... I am a dwarf
            Captain Carrot Ironfoundersson (in The Fifth Elephant)
--
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Thanks to you both for your answers. The thread mentioned by Christopher is
interesting, but the solution seems to use:
localectl set-x11-keymap xx
Problem is that localectl is not available with Sysv-elogind... It certainly
modifies the right config files, but which ones???

Also, I've tried lightdm and lxdm, and both use the fr keyboard with the
configuration I have. Note that 40-libinput.conf is the only file in
/etc/X11/xorg.conf.d, so there should be no problem with conf ordering (unless
a file which comes earlier in alphabetical order in /usr/share/X11/xorg.conf.d
may take precedence, but I do not think so).

So gdm does something different from other dm's. That's always the problem I
have with gnome. They do things differently, but I am unable to know what 
theYou can create a file 99-kb.conf in /usr/share/lightdm/lightdm.conf.d with 
content:
difference is.

I've also tried to run "gsettings list-recursively", which is supposed to give
all the settings in gnome. The relevant keys seem to be in
"org.gnome.desktop.input-sources"
specifically the "sources" and "xkb-options" keys. But where is the doc about
those keys? (how do I set them for all users, what is the format, etc). Ah, I
think that's what I am able to do when tweaking settings in gnome, but I must
be logged in the DE first, and it only makes the change for $USER, and it
saves the settings in a binary file!

Pierre
--
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Hello Pierre,

Firstly sorry for top posting before, it was soon after I woke up, and 
pre-coffee.

You may not have noticed this part of the solution in that thread:

You can create a file 99-kb.conf in /usr/share/lightdm/lightdm.conf.d with 
content:

[SeatDefaults]
greeter-setup-script=setxkbmap it

It makes lightdm run the setxkbmap command just before launching the login 
screen, overriding other configurations.


Try adding that 99-kb.conf to /etc/gdm

Once added, restart gdm

Regards,

Christopher.


--
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Hello Pierre,

I found another solution at gentoo forums, just omit step 2, as the poster 
found it was not needed:

Your problem piqued my curiosity, so I have just now installed the GNOME 3 
edition of Sabayon Linux (a binary derivative of Gentoo with its own overlay) 
in a virtual machine. I opted to use Sabayon Linux to investigate your problem 
because it is quick to install and similar to Gentoo. Sabayon Linux uses 
systemd rather than OpenRC, but I found that, even with systemd, GNOME 3 in 
Sabayon Linux exhibits the same problem you are experiencing. So I don't think 
the problem is specific to dantrell's OpenRC edition of GNOME 3; I think it is 
a general problem with GNOME 3.

Anyway, I did get GDM to use the German keyboard by default in the end, but it 
took a bit of messing around to get it to work:

Step 1. I did the usual set up of the German locale that has already been 
discussed:

Code:   
# cat /etc/locale.gen
en_GB ISO-8859-1
en_GB.UTF-8 UTF-8
de_DE ISO-8859-1
de_DE.UTF-8 UTF-8
# locale-gen
  * Generating 4 locales (this might take a while) with 1 jobs
  *  (1/4) Generating de_DE.ISO-8859-1 ...                                 [ ok 
]
  *  (2/4) Generating de_DE.UTF-8 ...                                      [ ok 
]
  *  (3/4) Generating en_GB.ISO-8859-1 ...                                 [ ok 
]
  *  (4/4) Generating en_GB.UTF-8 ...                                      [ ok 
]
  * Generation complete
# env-update && source /etc/profile
Regenerating /etc/ld.so.cache...        
Step 2. I added the "setkbmap de" command to the end of /etc/gdm/Init/Default 
(I'm not sure this is necessary):

Code:   
# tail /etc/gdm/Init/Default
       elif [ -n "$XKBTYPES" -a -n "$XKBCOMPAT" -a -n "$XKBSYMBOLS" ]; then
         $SETXKBMAP -types "$XKBTYPES" -compat "$XKBCOMPAT" -symbols 
"$XKBSYMBOLS"
       elif [ -n "$XKBSYMBOLS" ]; then
         $SETXKBMAP -symbols "$XKBSYMBOLS"
       fi
     fi
   fi
fi
setkbmap de
exit 0  


Step 3. I used 'Applications' > 'System Tools' > 'Settings' > 'Region & 
Language' and added the German keyboard under 'Input Sources', and moved 'German' to the top 
of the list of input sources. It appears to me that it is necessary to move German to the 
top of the list if you want the German keyboard layout to be the default in GDM.

Step 4. On the panel at the top of the screen, I selected the German keyboard 
layout, then I logged out.

Step 5. At the top of the GDM greeter screen, I selected the German keyboard 
layout.

Step 6. At the top of the GDM greeter screen, I then clicked on the Shutdown 
icon and shutdown the machine.

Step 7. I then booted the machine and the GDM greeter screen now shows German 
(de) as the default keyboard layout instead of English. I can logout, login, 
reboot and shutdown, and the keyboard layout on the GDM greeter screen now 
remains as German. (It took quite a bit of tinkering to get it to work in GNOME 
3, which has put me off GNOME 3 even more! ;-) )

EDIT: Yep, just proved it to myself: Step 2 is not necessary. The essential 
step to get German (or any other keyboard layout) to be the default layout on 
the GDM greeter screen is that it must be at the top of the list of input 
sources (Step 3).
_________________
Clevo W230SS: amd64 OpenRC elogind nvidia-drivers & xf86-video-intel.
Compal NBLB2: ~amd64 OpenRC elogind xf86-video-ati. Dual boot Win 7 Pro 64-bit.
KDE on both.Your problem piqued my curiosity, so I have just now installed the 
GNOME 3 edition of Sabayon Linux (a binary derivative of Gentoo with its own 
overlay) in a virtual machine. I opted to use Sabayon Linux to investigate your 
problem because it is quick to install and similar to Gentoo. Sabayon Linux 
uses systemd rather than OpenRC, but I found that, even with systemd, GNOME 3 
in Sabayon Linux exhibits the same problem you are experiencing. So I don't 
think the problem is specific to dantrell's OpenRC edition of GNOME 3; I think 
it is a general problem with GNOME 3.

Anyway, I did get GDM to use the German keyboard by default in the end, but it 
took a bit of messing around to get it to work:

Step 1. I did the usual set up of the German locale that has already been 
discussed:

Code:   
# cat /etc/locale.gen
en_GB ISO-8859-1
en_GB.UTF-8 UTF-8
de_DE ISO-8859-1
de_DE.UTF-8 UTF-8
# locale-gen
  * Generating 4 locales (this might take a while) with 1 jobs
  *  (1/4) Generating de_DE.ISO-8859-1 ...                                 [ ok 
]
  *  (2/4) Generating de_DE.UTF-8 ...                                      [ ok 
]
  *  (3/4) Generating en_GB.ISO-8859-1 ...                                 [ ok 
]
  *  (4/4) Generating en_GB.UTF-8 ...                                      [ ok 
]
  * Generation complete
# env-update && source /etc/profile
Regenerating /etc/ld.so.cache...        
Step 2. I added the "setkbmap de" command to the end of /etc/gdm/Init/Default 
(I'm not sure this is necessary):

Code:   
# tail /etc/gdm/Init/Default
       elif [ -n "$XKBTYPES" -a -n "$XKBCOMPAT" -a -n "$XKBSYMBOLS" ]; then
         $SETXKBMAP -types "$XKBTYPES" -compat "$XKBCOMPAT" -symbols 
"$XKBSYMBOLS"
       elif [ -n "$XKBSYMBOLS" ]; then
         $SETXKBMAP -symbols "$XKBSYMBOLS"
       fi
     fi
   fi
fi
setkbmap de
exit 0  


Step 3. I used 'Applications' > 'System Tools' > 'Settings' > 'Region & 
Language' and added the German keyboard under 'Input Sources', and moved 'German' to the top 
of the list of input sources. It appears to me that it is necessary to move German to the 
top of the list if you want the German keyboard layout to be the default in GDM.

Step 4. On the panel at the top of the screen, I selected the German keyboard 
layout, then I logged out.

Step 5. At the top of the GDM greeter screen, I selected the German keyboard 
layout.

Step 6. At the top of the GDM greeter screen, I then clicked on the Shutdown 
icon and shutdown the machine.

Step 7. I then booted the machine and the GDM greeter screen now shows German 
(de) as the default keyboard layout instead of English. I can logout, login, 
reboot and shutdown, and the keyboard layout on the GDM greeter screen now 
remains as German. (It took quite a bit of tinkering to get it to work in GNOME 
3, which has put me off GNOME 3 even more! ;-) )

EDIT: Yep, just proved it to myself: Step 2 is not necessary. The essential 
step to get German (or any other keyboard layout) to be the default layout on 
the GDM greeter screen is that it must be at the top of the list of input 
sources (Step 3).
_________________
Clevo W230SS: amd64 OpenRC elogind nvidia-drivers & xf86-video-intel.
Compal NBLB2: ~amd64 OpenRC elogind xf86-video-ati. Dual boot Win 7 Pro 64-bit.
KDE on both.


The full thread is available at:

https://forums.gentoo.org/viewtopic-t-1066664.html

I feel stupid, but none of the solutions proposed in those threads seem to 
work...

And even the documentation is not accurate: they say that a keyboard layout
button should appear in gdm when there are more than one user, but I see none,
even after creating a second user!

Pierre

I just started an elogind build on a VMWare VM for testing the VMWare driver. I'll proceed through my standard order and try to get this solved before I tag GNOME. I know of a couple of other potential problems that need to be addressed, especially in gnome-settings-daemon (there are some panels that are completely unusable, and I'd like to have those fixed or at least hidden on elogind systems, such as the Sharing panel). I'd rather not ship out broken software like that :-)

ETA is tomorrow or early Sunday, depending on network speed really. I just copied all of my sources over to a USB drive.

--
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to