From 0b9dace01837edd87eb65f20789063abcd5cf491 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 11 Oct 2026 01:16:30 +0200 Subject: [PATCH] Unify input methods with installer keyboard selection (#14433) * Unify input methods with the installer keyboard selection * Preserve inherited input keys and later keyboard changes * Exercise input engines across desktop toolkits * Show input modes in the keyboard indicator * Keep Pinyin setup prompts visible * Remember input selections before an app gains focus * Remove the Japanese input welcome notification * Show explicit choices on notification cards * Suppress the Cloudpinyin first-use prompt * Show the input switching shortcut in keyboard hints * Verify input setup and composition stay quiet * Use Super+I for input switching independently of Fcitx keys * Restore linked input settings and attribute test notifications to Fcitx * Correct the input setup shortcut hint * Keep input tooltips to the name and switching shortcut * Place the input language selector with the right bar widgets * Show input switching only for multiple layouts or methods * Unify input method and keyboard layout switching * Select keyboard layouts and input methods in the Typing menu * Apply typing selections immediately from the menu * Use installer keyboard choices and keep typing selections accurate * Queue typing changes and wait for saved selections * Keep queued typing selections when reopening the menu * Cycle keyboard layouts alongside composition engines * Avoid shadowing Python typing and retain pending mixed input selections * Keep input clicks working through controller and compositor failures * Move the keyboard layout widget to the right side of existing bars Co-Authored-By: Claude Opus 5.5 * Map keyboard choices to the layouts the installer sets Co-Authored-By: Claude Opus 5.5 * Keep the switching order when changing input methods Co-Authored-By: Claude Opus 5.5 * Set input method fonts only after the selection saves Co-Authored-By: Claude Opus 5.5 * Restore confirmed picker checks when an immediate change fails Co-Authored-By: Claude Opus 5.5 * Route Super+I through the shell's input reader so unfocused choices stick Co-Authored-By: Claude Opus 5.5 * Restore the input group when the font preference cannot be written Co-Authored-By: Claude Opus 5.5 * Drop the azerty conversion now that the installer no longer offers it Co-Authored-By: Claude Opus 5.5 * Apply the owner's keyboard layout once before persisting the input choice A quattro merge kept a second apply_keyboard after the retry loop, which re-ran loadkeys and firstboot, ignored their failure, and overwrote the XKB layout setup supplies for keymaps kbd-model-map lacks. Co-Authored-By: Claude Opus 5.5 * Give the Lao keyboard choice a Lao desktop layout The row used la-latin1, kbd's Latin American Spanish keymap, so Lao installs typed Spanish. There is no Lao console keymap; like Korean, the console stays US and the desktop gets la, which Omarchy keeps behind US as a non-Latin layout. Co-Authored-By: Claude Opus 5.5 * Load engines installed after Fcitx started when they are selected The Typing menu refused an engine whose package an update had installed, since Fcitx discovers engines only at startup. Restart input once and wait for the engine; name the package when it really is not installed. Co-Authored-By: Claude Opus 5.5 * Cycle input methods back with Super+Shift+I Co-Authored-By: Claude Opus 5.5 * Drop notification action buttons now that the Pinyin prompt is suppressed Co-Authored-By: Claude Opus 5.5 * Cycle input only through the shell's reader Without the shell there is no bar or menu either, so the one-shot cycling path only duplicated the reader's logic. Co-Authored-By: Claude Opus 5.5 * Add engines from the command line through the Typing menu's path omarchy setup input had its own restart, append, select and live-rollback code in configure.py, parallel to the menu's. It now installs the packages and appends through typing_setup, leaving configure.py with install-time seeding and update defaults. Co-Authored-By: Claude Opus 5.5 * Keep Ctrl+Space out of Fcitx's toggles instead of probing for it The terminal prefix bind read the Fcitx config and profile on every press to avoid fighting a Ctrl+Space toggle. configure --defaults now removes that key from every trigger list, so the bind only checks for a terminal. Co-Authored-By: Claude Opus 5.5 * Run the input-method scripts with the system Python A bare python resolves through PATH, so a mise, pyenv or venv interpreter could run them without the system's PyGObject. Co-Authored-By: Claude Opus 5.5 --------- Co-authored-by: Claude Opus 5.5 --- bin/omarchy-input-method | 22 ++ bin/omarchy-menu-keybindings | 2 +- bin/omarchy-menu-select | 50 ++- bin/omarchy-provision-owner | 2 + bin/omarchy-restart-xcompose | 23 +- bin/omarchy-setup-input | 29 ++ bin/omarchy-setup-keyboard | 7 + bin/omarchy-upgrade-to-quattro | 2 + config/fcitx5/conf/pinyin.conf | 3 + config/fcitx5/conf/quickphrase.conf | 2 + config/fcitx5/conf/wayland.conf | 1 + config/fcitx5/config | 19 + config/omarchy/shell.json | 6 +- default/hypr/bindings/input-method.lua | 29 ++ default/hypr/bindings/jis.lua | 43 +++ default/hypr/input.lua | 34 +- default/hypr/keyboard.lua | 61 ++++ default/hypr/omarchy.lua | 2 + default/input-methods/configure.py | 333 ++++++++++++++++++ default/input-methods/indicator.py | 189 ++++++++++ .../input-methods/org.fcitx.Fcitx5.service | 5 + default/input-methods/presets.json | 7 + default/input-methods/typing_setup.py | 251 +++++++++++++ default/omarchy/omarchy-menu.jsonc | 3 + default/systemd/user/omarchy-fcitx5.service | 5 +- docs/input-methods.md | 25 ++ docs/menu.md | 7 + docs/omarchy-shell.md | 1 + install/omarchy-base.packages | 4 + install/provisioning/setup-form.sh | 29 +- install/user/all.sh | 1 + install/user/first-run/enable-user-units.sh | 2 + install/user/input-method.sh | 1 + manual/05-the-top-bar.md | 2 +- manual/34-keyboard-mouse-trackpad.md | 12 +- migrations/1791367434.sh | 4 + migrations/1791640449.sh | 5 + shell/Commons/InputMethodState.qml | 38 ++ shell/Commons/qmldir | 1 + .../bar/widgets/KeyboardLayout.manifest.json | 5 +- shell/plugins/bar/widgets/KeyboardLayout.qml | 17 +- .../bar/widgets/KeyboardLayoutModel.js | 23 +- shell/plugins/menu/Menu.qml | 123 ++++++- shell/plugins/menu/MenuModel.js | 23 ++ shell/shell.qml | 6 + .../input-method-notifications.py | 30 ++ test/acceptance.d/input-method-state.py | 85 +++++ test/acceptance.d/input-methods-test.sh | 186 ++++++++++ test/shell.d/hyprland-jis-bindings-test.sh | 126 +++++++ test/shell.d/hyprland-keyboard-layout-test.sh | 29 ++ test/shell.d/input-acceptance-checks.py | 144 ++++++++ test/shell.d/input-acceptance-test.sh | 5 + test/shell.d/input-indicator-test.sh | 204 +++++++++++ test/shell.d/input-method-checks.py | 219 ++++++++++++ test/shell.d/input-method-test.sh | 6 + test/shell.d/keybindings-menu-test.sh | 4 + test/shell.d/keyboard-layout-test.sh | 20 ++ test/shell.d/menu-test.sh | 5 + test/shell.d/owe-integration-test.sh | 9 +- test/shell.d/provision-owner-keyboard-test.sh | 10 +- test/shell.d/setup-form-test.sh | 15 + test/shell.d/systemd-test.sh | 2 +- test/shell.d/typing-setup-checks.py | 166 +++++++++ test/shell.d/typing-setup-test.sh | 16 + 64 files changed, 2687 insertions(+), 53 deletions(-) create mode 100755 bin/omarchy-input-method create mode 100755 bin/omarchy-setup-input create mode 100755 bin/omarchy-setup-keyboard create mode 100644 config/fcitx5/conf/pinyin.conf create mode 100644 config/fcitx5/conf/quickphrase.conf create mode 100644 config/fcitx5/conf/wayland.conf create mode 100644 config/fcitx5/config create mode 100644 default/hypr/bindings/input-method.lua create mode 100644 default/hypr/bindings/jis.lua create mode 100644 default/hypr/keyboard.lua create mode 100644 default/input-methods/configure.py create mode 100644 default/input-methods/indicator.py create mode 100644 default/input-methods/org.fcitx.Fcitx5.service create mode 100644 default/input-methods/presets.json create mode 100644 default/input-methods/typing_setup.py create mode 100644 docs/input-methods.md create mode 100644 install/user/input-method.sh create mode 100644 migrations/1791367434.sh create mode 100644 migrations/1791640449.sh create mode 100644 shell/Commons/InputMethodState.qml create mode 100644 test/acceptance.d/input-method-notifications.py create mode 100644 test/acceptance.d/input-method-state.py create mode 100644 test/acceptance.d/input-methods-test.sh create mode 100755 test/shell.d/hyprland-jis-bindings-test.sh create mode 100644 test/shell.d/input-acceptance-checks.py create mode 100755 test/shell.d/input-acceptance-test.sh create mode 100755 test/shell.d/input-indicator-test.sh create mode 100644 test/shell.d/input-method-checks.py create mode 100644 test/shell.d/input-method-test.sh create mode 100644 test/shell.d/typing-setup-checks.py create mode 100644 test/shell.d/typing-setup-test.sh diff --git a/bin/omarchy-input-method b/bin/omarchy-input-method new file mode 100755 index 00000000..b687b22f --- /dev/null +++ b/bin/omarchy-input-method @@ -0,0 +1,22 @@ +#!/bin/bash + +# omarchy:summary=Configure, inspect, or switch input methods +# omarchy:args= +# omarchy:hidden=true + +set -euo pipefail + +if [[ ${1:-} == "cycle" ]]; then + direction=${2:-next} + if [[ $direction != "next" && $direction != "back" ]]; then + echo "Usage: omarchy-input-method cycle [back]" >&2 + exit 1 + fi + # The shell's reader retains a choice made while nothing has focus. + if [[ $(omarchy-shell shell cycleInput "$direction") != "ok" ]]; then + echo "The shell's input reader is not running" >&2 + exit 1 + fi +else + /usr/bin/python3 "$OMARCHY_PATH/default/input-methods/configure.py" "$@" +fi diff --git a/bin/omarchy-menu-keybindings b/bin/omarchy-menu-keybindings index ca5bdef0..18ca0d21 100755 --- a/bin/omarchy-menu-keybindings +++ b/bin/omarchy-menu-keybindings @@ -555,7 +555,7 @@ output_binding_records_uncached() { keybindings_cache_key() { { - printf 'v14\n' + printf 'v15\n' hyprctl devices 2>/dev/null | grep -F 'active keymap:' cat "$key_names_file" 2>/dev/null hyprctl binds 2>/dev/null diff --git a/bin/omarchy-menu-select b/bin/omarchy-menu-select index 1404665f..18f3ed14 100755 --- a/bin/omarchy-menu-select +++ b/bin/omarchy-menu-select @@ -1,9 +1,9 @@ #!/bin/bash -# omarchy:summary=Pick one option from a menu +# omarchy:summary=Pick one or multiple options from a menu # omarchy:group=menu # omarchy:name=select -# omarchy:args=prompt [option...] [-- menu args...] +# omarchy:args=prompt [option...] [-- --multiple --selected --on-change --change-key --width --maxheight ] # omarchy:examples=omarchy menu select Format jpg png|omarchy-menu-select Resolution 4k 1080p 720p -- --width 400 # An option may lead with an icon, as "