From b8832a0174ffec8033287daeb5201cc642889428 Mon Sep 17 00:00:00 2001 From: Gabriel Brown Date: Tue, 18 Aug 2026 13:01:28 -0400 Subject: [PATCH] Preserve the GNOME Caps Lock behavior --- config/dot/hypr/input.lua | 2 +- config/dot/quickshell/config/PreferenceSchema.qml | 2 +- tests/quickshell/xkb-presets-contract.sh | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/config/dot/hypr/input.lua b/config/dot/hypr/input.lua index 13d1c89..a33501d 100644 --- a/config/dot/hypr/input.lua +++ b/config/dot/hypr/input.lua @@ -12,7 +12,7 @@ hl.config({ kb_layout = prefs.get("keyboardLayout", "us"), kb_variant = prefs.get("keyboardVariant", ""), kb_model = "", - kb_options = prefs.get("keyboardOptions", ""), + kb_options = prefs.get("keyboardOptions", "caps:escape_shifted_capslock"), kb_rules = "", numlock_by_default = prefs.get("numlockByDefault", true), diff --git a/config/dot/quickshell/config/PreferenceSchema.qml b/config/dot/quickshell/config/PreferenceSchema.qml index c55b267..a06e6b6 100644 --- a/config/dot/quickshell/config/PreferenceSchema.qml +++ b/config/dot/quickshell/config/PreferenceSchema.qml @@ -436,7 +436,7 @@ Singleton { hypr: { path: ["input", "kb_variant"], option: "input:kb_variant", readAs: "str" } }, { - key: "keyboardOptions", type: "string", def: "", group: "input", + key: "keyboardOptions", type: "string", def: "caps:escape_shifted_capslock", group: "input", // XKB option names are colon-separated pairs in a comma-separated // list, e.g. "compose:ralt,caps:escape". pattern: "^$|^[a-z0-9_]+:[a-z0-9_]+(,[a-z0-9_]+:[a-z0-9_]+)*$", diff --git a/tests/quickshell/xkb-presets-contract.sh b/tests/quickshell/xkb-presets-contract.sh index 48b36db..c15bd6f 100755 --- a/tests/quickshell/xkb-presets-contract.sh +++ b/tests/quickshell/xkb-presets-contract.sh @@ -9,6 +9,7 @@ set -euo pipefail repo_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" page="$repo_dir/config/dot/quickshell/modules/settings/ShortcutsPage.qml" input="$repo_dir/config/dot/hypr/input.lua" +schema="$repo_dir/config/dot/quickshell/config/PreferenceSchema.qml" fail() { printf 'xkb presets contract: %s\n' "$1" >&2 @@ -37,7 +38,9 @@ rg -Fq 'option.indexOf(prefix) !== 0' "$page" \ rg -Fq 'kb_variant = prefs.get("keyboardVariant", "")' "$input" \ || fail 'Hyprland does not replay the stored keyboard variant' -rg -Fq 'kb_options = prefs.get("keyboardOptions", "")' "$input" \ +rg -Fq 'key: "keyboardOptions", type: "string", def: "caps:escape_shifted_capslock"' "$schema" \ + || fail 'the shipped XKB default no longer matches the migrated GNOME behavior' +rg -Fq 'kb_options = prefs.get("keyboardOptions", "caps:escape_shifted_capslock")' "$input" \ || fail 'Hyprland does not replay the stored keyboard options' printf 'xkb presets contract: PASS\n'