Fix: add US fallback for non-US keyboard layouts in Hyprland #2293
+24
−7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
This pull request addresses the installation issue where users selecting a non-US keyboard layout during installation would find their Hyprland system "bricked" due to a lack of a working input method for system shortcuts and text editing (especially in nvim which is the default editor).
Problem Addressed (Fixes #2054):
Previously, if a user chose a keyboard layout like
ru
or any other non-US layout, the Hyprland configuration would only include that single layout. This led to a situation where essential system shortcuts (which often rely on aus
layout interpretation) would not function, and users would be unable to type effectively in applications like nvim (the default editor), making it impossible to even enter insert mode or modify configuration files.Solution:
This script modification ensures that:
/etc/vconsole.conf
is anything other thanus
, theus
layout is prepended to thekb_layout
variable (e.g.,us,ru
).kb_options
are set togrp:alt_shift_toggle
to allow users to easily switch betweenus
and their chosen layout (e.g., Russian) usingAlt+Shift
.us
, the configuration remains simple, setting onlykb_layout = us
without additional options.kb_layout
,kb_variant
, andkb_options
lines are removed before appending new ones to prevent duplication and ensure a clean configuration update.This fix prevents the system from becoming unusable for non-US keyboard users, providing a reliable fallback to the
us
layout when needed for system interactions and ensuring a smooth user experience.Testing:
XKBLAYOUT="ru"
in/etc/vconsole.conf
:kb_layout
correctly set tous,ru
, andkb_options
togrp:alt_shift_toggle
.XKBLAYOUT="us"
in/etc/vconsole.conf
:kb_layout
correctly set tous
, andkb_options
remained