• Can't remap keyboard to a custom layout that works everywhere

    From Zoe@21:1/5 to All on Mon Jan 23 03:50:01 2023
    Dear all,

    Please help me remap my keyboard to a completely custom layout such that it's the active layout everywhere (dm-crypt at boot, display manager and desktop environments), permanently.

    More detail:

    My laptop has a customized layout. Not QWERTY, not Dvorak, but a non-standard one I came up with. I'm running Debian 11.6 stable, and up until now I've been using only the XFCE desktop environment (4.16) and the lightdm display manager.

    I remapped the keyboard by copying my xkb configuration file to /usr/share/X11/xkb/symbols, ran "setxkbmap -v myKeyboardConf", and made it permanent with "localectl --no-convert set-x11-keymap myKeyboardConf".

    This worked out for XFCE and lightdm. It didn't pass on to the dm-crypt prompt that asks me to decrypt my root partition at boot. However, upon a random reboot, it transferred to dm-crypt too. I don't know how, but I was glad.

    I recently wanted to try GNOME (3.38), so I installed it (apt-get install task-gnome-desktop). During this I also changed my display manager to the GNOME Display Manager (gdm3). After rebooting, things got screwed up.

    My customized layout remained in dm-crypt, but reverted to QWERTY US English in gdm3, GNOME and even XFCE. After this, and since for now I want to stick with X11 regardless, I configured gdm3 to use X11. (The "GNOME on Xorg" option disappeared from gdm3's session selector, I only have "GNOME" that starts a GNOME X11 session, not sure if it's intended.) If I log into XFCE and run setxkbmap and localectl, the custom layout is restored. However, it won't persist beyond logging out or restarting, it won't transfer to gdm3 or GNOME, and it can be set the same way in GNOME, but also won't persist.

    As a side-effect, XFCE got screwed too. An example: a random set of my custom keyboard shortcuts in Settings -> Keyboard -> Application Shortcuts stopped working. They're still there, but I need to remove and re-add them in every session. Also, xflock4 (XFCE's screen locker) no longer does anything.

    In case it's relevant, my /etc/initramfs-tools/initramfs.conf has a "KEYMAP=n" line. My /etc/default/keyboard has a "XKBLAYOUT=myKeyboardConf" line. XFCE's Settings -> Keyboard -> Layout -> Keyboard layout lists "English (US)" before I run setxkbmap and localectl, and "myKeyboardConf" after. In contrast, GNOME's Settings -> Region and Language -> Input sources lists "myKeyboardConf" both before and after running setxkbmap and localectl.

    At this point I'm scared to do anything, fearing that things will get even worse, so I decided to ask you:

    1. Please advise me how to remap my keyboard such that it will work in every environment, permanently (dm-crypt, display managers, and user sessions - both XFCE and GNOME, preferably with Wayland too). Unfortunately I can't modify the firmware of my laptop's keyboard. I guess I could tweak gdm3 to use my custom layout and add setxkbmap and localectl to my autostart entries, but that's just more patchwork on top of the existing mess, and may break upon future changes (e.g. later I want to try Wayland, I may change my display manager, etc). I'm looking for a solution on a more fundamental level. Maybe setxkbmap is not the right framework for this. Maybe I missed a basic setting. I'm open to suggestions.

    2. If you know why installing GNOME screws up things that are internal to XFCE, and how to fix them, don't hesitate to answer.

    Thank you very much,

    Zoe

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)