Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions modules/system/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,16 @@ if systemd-detect-virt --quiet --vm; then
keymap=us variant=
fi

# --no-convert: left to convert, localed derives each side from the other, and for
# plain US that picks the console keymap us-acentos (dead keys) and flips on every run.
if [ "$(field 'VC Keymap')" != "$keymap" ]; then
sudo localectl set-keymap "$keymap"
sudo localectl --no-convert set-keymap "$keymap"
fi

# localectl prints no X11 Variant row when the variant is unset.
if [ "$(field 'X11 Layout')" != "us" ] || [ "$(field 'X11 Model')" != "pc105" ] ||
[ "$(field 'X11 Variant')" != "$variant" ] || [ "$(field 'X11 Options')" != "caps:none" ]; then
sudo localectl set-x11-keymap us pc105 "$variant" caps:none
sudo localectl --no-convert set-x11-keymap us pc105 "$variant" caps:none
fi

if [ "$(field 'System Locale')" != "LANG=en_US.UTF-8" ]; then
Expand Down
8 changes: 4 additions & 4 deletions modules/system/tests/test_keymap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ check() {
[ "$(cat "$T/log")" = "$3" ] || fail "vm=$1 from $2: localectl calls were: $(cat "$T/log")"
}

check 1 dvorak '[set-keymap][us]
[set-x11-keymap][us][pc105][][caps:none]'
check 1 dvorak '[--no-convert][set-keymap][us]
[--no-convert][set-x11-keymap][us][pc105][][caps:none]'
check 1 us ''
check 0 us '[set-keymap][dvorak]
[set-x11-keymap][us][pc105][dvorak][caps:none]'
check 0 us '[--no-convert][set-keymap][dvorak]
[--no-convert][set-x11-keymap][us][pc105][dvorak][caps:none]'
check 0 dvorak ''

echo "system keymap tests passed"
Loading