How to Add and Switch Between Multiple Keyboard Layouts on Fedora

Add and switch keyboard layouts on Fedora via Settings or the localectl command.

The layout switch that never sticks

You install Fedora, open a terminal, and realize your keyboard only speaks one language. You need to switch to German for a configuration file, or French for a quick message. You open Settings, click around, and the layout either does not change or the shortcut stops working after a reboot. The confusion usually comes from Linux handling keyboard layouts in three completely separate layers. The virtual console uses a kernel keymap. X11 relies on the X Keyboard Extension. Wayland compositors manage input directly through their own configuration schemas. Fixing it requires knowing which layer you are actually touching.

What the system is actually doing

Linux does not store a single keyboard layout setting. It splits input handling across different subsystems that rarely talk to each other. The virtual console (TTY) uses the kernel's built-in keymap system, which maps scancodes to characters before any display server starts. X11 uses the X Keyboard Extension, a complex ruleset that translates hardware events into X11 key symbols. Wayland compositors like GNOME and KDE bypass XKB entirely and manage input through D-Bus schemas and compositor-specific plugins.

When you run localectl set-keymap, you are only changing the TTY. Your desktop environment ignores it. When you change a setting in GNOME, it writes to a GVariant schema that the compositor reads on startup. The shortcut keys also live in separate configuration spaces. A mismatch between these layers is why your layout switch works in a terminal but fails in a browser, or why a reboot resets your changes. The system is not broken. It is just compartmentalized.

Understand the input stack before you start typing commands. Treat the desktop and the console as two different machines.

Configure the desktop environment

The default Fedora Workstation uses GNOME. GNOME stores keyboard layouts in the org.gnome.desktop.input-sources schema. The schema expects a list of tuples. Each tuple contains an input method engine and a layout identifier. The standard engine for physical keyboards is xkb. You can set multiple layouts by passing a properly formatted array.

Here is how to set US and German as your active desktop layouts using the command line.

# Set the primary layout to US and the secondary layout to German
gsettings set org.gnome.desktop.input-sources sources "['xkb', 'us'], ['xkb', 'de']"
# The compositor reads this schema on startup and applies the layout immediately
# No reboot is required for the change to take effect in running applications

The gsettings command writes directly to the D-Bus configuration backend. GNOME monitors this schema and updates the input method engine in real time. You do not need to log out. The change applies to all windows that respect the desktop environment's input configuration.

If you prefer the graphical interface, open Settings, navigate to Keyboard, and click Input Sources. Press the plus button and select your layout. GNOME writes the same gsettings value behind the scenes. The GUI is just a wrapper around the D-Bus schema.

Set the shortcut to match your muscle memory. GNOME defaults to Super + Space. You can change it in the same Keyboard settings panel under the Input Sources section. Click the three-dot menu next to your layout and select Keyboard Shortcut. Press your preferred key combination. The system saves it to the same schema.

Verify the schema value matches your intention before you close the terminal. D-Bus writes can fail silently if the session bus is not running.

Configure the virtual console

The virtual console operates outside the desktop environment. It uses the kernel's keymap subsystem, which localectl manages. This layer only affects TTY sessions (Ctrl+Alt+F3 through F6) and SSH sessions that do not forward X11 or Wayland display variables.

Here is how to configure the console keymap for US and German.

# Apply the US and German keymaps to the virtual console
sudo localectl set-keymap us,de
# The comma separates multiple layouts for the console switcher
# This command updates /etc/vconsole.conf and applies the change immediately

The localectl set-keymap command writes to /etc/vconsole.conf and reloads the console driver. It does not touch X11 or Wayland. If you only run this command, your desktop layout will remain unchanged. This is intentional. The console and the display server maintain separate input states to prevent configuration drift during recovery or headless operation.

You can verify the console configuration by reading the generated file.

# Display the current console keymap configuration
cat /etc/vconsole.conf
# The file contains KEYMAP=us,de and optionally FONT= settings
# systemd-vconsole-setup reads this file on boot and applies the keymap

The console switcher uses Alt + Left/Right Arrow by default to cycle through layouts. This differs from the desktop shortcut. Remember that the console does not support complex input methods like IBus or Fcitx. It only supports standard QWERTY, AZERTY, Dvorak, and similar physical keyboard mappings.

Keep the console and desktop configurations separate. Mixing them causes silent fallback to the US layout.

Verify the configuration

You need to check each layer independently. The desktop environment and the console do not share state. Running a single verification command will only show half the picture.

Here is how to query the current desktop layout configuration.

# Retrieve the active input sources from the GNOME schema
gsettings get org.gnome.desktop.input-sources sources
# The output returns a GVariant list like [['xkb', 'us'], ['xkb', 'de']]
# If the output is empty, the desktop will fall back to the system locale

Here is how to check the console keymap status.

# Display the current locale and keymap configuration for the system
localectl status
# The output shows X11 layout, console keymap, and system locale
# Verify that KEYMAP matches your intended console configuration

If you are running an X11 session instead of Wayland, you can query the active XKB state directly.

# Query the current X11 keyboard extension configuration
setxkbmap -query
# The output lists rules, model, layout, variant, and options
# This only works on X11 sessions and returns nothing on Wayland

Wayland does not expose a direct query command for the active layout. The compositor manages it internally. You can rely on the gsettings output as the source of truth for GNOME Wayland sessions. KDE Plasma uses kwriteconfig5 and stores layouts in ~/.config/kwinrc and ~/.config/kcminputrc. The verification steps differ slightly but follow the same layer separation principle.

Check the schema before you troubleshoot. Half the time the configuration is correct but the session bus lost the update.

Common pitfalls and error patterns

The most frequent issue is running localectl set-keymap and expecting the desktop to change. The command only affects the TTY. Your browser and terminal emulator will continue using the desktop schema. The system is not ignoring you. It is just looking at the wrong configuration file.

Another common problem is missing language packs. Fedora ships with a minimal set of locale data by default. If you add a layout but the corresponding language pack is not installed, the input method engine may fall back to US or fail to render dead keys correctly. Install the required pack before configuring the layout.

# Install the German language pack to ensure proper dead key and accent support
sudo dnf install glibc-langpack-de
# The package provides locale data, character maps, and input method rules
# Run this before setting the layout to prevent silent fallback behavior

Shortcut conflicts also cause frustration. GNOME reserves Super + Space for the application overview in older versions, and Alt + Shift is the traditional X11 standard. If your shortcut does nothing, check the Keyboard Shortcuts panel for overlapping bindings. The compositor will prioritize the first registered handler. Remove the conflict or assign a different combination.

Wayland sessions sometimes show a delayed layout switch in certain applications. Electron apps and older GTK2 programs do not always listen to D-Bus input method updates. They cache the layout at startup. Restart the application after changing the schema. The compositor cannot force a running process to reload its input state.

SELinux does not block keyboard layout changes. Input configuration writes go through the user session bus, which runs in an unconfined or user domain context. You will not see AVC denials for gsettings or localectl operations. If you see permission errors, check your user group membership or session bus socket permissions instead.

Read the actual schema output before guessing. Configuration drift is almost always a session bus or missing package issue.

Choose the right tool for your session

Use the Settings application when you want immediate visual feedback and automatic shortcut assignment. Use gsettings when you are scripting a desktop environment configuration or managing a remote session that requires programmatic control. Use localectl set-keymap when you only need to change the layout for the virtual console or headless SSH sessions that bypass the desktop environment. Stick to the compositor defaults when you are running a standard GNOME or KDE session and want the layout to survive system updates. Install the matching glibc-langpack-* package when you add a layout that uses dead keys or non-Latin character sets.

Reboot only if the session bus fails to propagate the change. Most layout updates apply instantly.

Where to go next