Skip to content

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.

2 points2 comments
Open on Reddit
About this post
Posted
Archived
Edited
Score
2 · 100% up
Kind
Text
ID
17flyev

Author

48
posts
25
comments
11
media
View profile

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.

1 points

Have you tried setting the keymap via localectl set-x11-keymap pl?

Log out and back in again for changes to make effect.

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.