Change Keyboard Layout with localectl
Use localectl set-x11-keymap to set the system-wide keyboard layout and localectl set-keymap for the text console.
01Command
$ sudo localectl set-x11-keymap de02What it does
`localectl set-keymap de` changes the layout in the text consoles (Ctrl+Alt+F3), while `set-x11-keymap de` changes the graphical session default that applies at the login screen. List valid codes with `localectl list-x11-keymap-layouts`. On GNOME and KDE, Settings has its own input-source switcher which takes precedence for your user session, so localectl mainly fixes the login screen and console layout.
03Risk
04Undo
$ sudo localectl set-x11-keymap us05Sources
- Linux console/Keyboard configuration - ArchWikiEvidence: Describes how localectl set-keymap configures the virtual console keymap while set-x11-keymap configures the graphical X11 keymap.
- localectl(1) - Linux manual pageEvidence: localectl set-x11-keymap sets the system default X11 keyboard layout, model, variant and options; set-locale changes the system locale.
Last verified: 2026-09-18 · Category: System & Settings
06Related solutions
timedatectl lists, sets, and verifies the system timezone and NTP sync status on systemd distributions.
hostnamectl sets the static, transient, and pretty hostname in one step on systemd distros, no reboot required.
systemctl list-timers shows every scheduled timer unit with its last and next run times, which many users forget replaces cron on modern distros.