Keyboard layout resets at boot
Hi, so after each boot my PC loses the ability to type in diacritics. I can really easily fix this by running `setxkbmap pl`. However, the harder part is to keep that setting after boot. I couldn't find any way, so I'm turning to you.
Let's run some commands "before" and "after" this magical command that is `setxbkmap pl`.
# Before xbk
$ localectl status
System Locale: LANG=en_GB.UTF-8
LC_CTYPE=pl_PL.UTF-8
LC_NUMERIC=pl_PL.UTF-8
LC_TIME=pl_PL.UTF-8
LC_COLLATE=pl_PL.UTF-8
LC_MONETARY=pl_PL.UTF-8
LC_PAPER=pl_PL.UTF-8
LC_ADDRESS=pl_PL.UTF-8
LC_MEASUREMENT=pl_PL.UTF-8
LC_IDENTIFICATION=pl_PL.UTF-8
VC Keymap: pl2
X11 Layout: pl $ setxkbmap -query rules: evdev model: pc105 layout: pl $ cat /etc/X11/xorg.conf.d/00-keyboard.conf Section "InputClass" Identifier "system-keyboard" MatchIsKeyboard "on" Option "XkbLayout" "pl" EndSection
# After xbk
$ localectl status
System Locale: LANG=en_GB.UTF-8 LC_CTYPE=pl_PL.UTF-8 LC_NUMERIC=pl_PL.UTF-8 LC_TIME=pl_PL.UTF-8 LC_COLLATE=pl_PL.UTF-8 LC_MONETARY=pl_PL.UTF-8 LC_PAPER=pl_PL.UTF-8 LC_ADDRESS=pl_PL.UTF-8 LC_MEASUREMENT=pl_PL.UTF-8 LC_IDENTIFICATION=pl_PL.UTF-8 VC Keymap: pl2 X11 Layout: pl $ setxkbmap -query rules: evdev model: pc105 layout: pl $ cat /etc/X11/xorg.conf.d/00-keyboard.conf Section "InputClass" Identifier "system-keyboard" MatchIsKeyboard "on" Option "XkbLayout" "pl" EndSection
Since `setxkbmap pl` is the fix, I tried to "run it automatically" at every boot some other way.
Things I've tried as a last resort:
- added the same command I'd run in cmd into the file `sudo nano /etc/gdm/Xsession` before the line starting with `$sysmodmap` - FAIL
- added `setxkbmap pl` to `~/.xinitrc` which runs before GNU Desktop environment - FAIL
- added `setxkbmap pl` to `~/.xprofile` and then in `~/.bashrc` added the line `source ~/.xprofile` - FAIL
Edited 24 Oct 2023. We only hold this version.
About this post
- Posted
- Archived
- Edited
- Score
- 2 · 100% up
- Kind
- Text
- ID
- 17flyev
3 comments
None of this will take effect until the os actually starts. Do you have a problem during the boot phase itself, like when entering encrypted password?
There may be an option in bios to change default state of numlock or other key that toggles keyboard.
No, no problems during boot.
Have you tried setting the keymap via
localectl set-x11-keymap pl?Log out and back in again for changes to make effect.