* 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 <noreply@anthropic.com> * Map keyboard choices to the layouts the installer sets Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Keep the switching order when changing input methods Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Set input method fonts only after the selection saves Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Restore confirmed picker checks when an immediate change fails Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Route Super+I through the shell's input reader so unfocused choices stick Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Restore the input group when the font preference cannot be written Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Drop the azerty conversion now that the installer no longer offers it Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * 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 <noreply@anthropic.com> * 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 <noreply@anthropic.com> * 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 <noreply@anthropic.com> * Cycle input methods back with Super+Shift+I Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Drop notification action buttons now that the Pinyin prompt is suppressed Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * 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 <noreply@anthropic.com> * Add engines from the command line through the Typing menu's path omarchy setup input <engine> 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 <noreply@anthropic.com> * 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 <noreply@anthropic.com> * 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 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
127 lines
4.4 KiB
Bash
Executable File
127 lines
4.4 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
set -euo pipefail
|
|
|
|
source "$(dirname "${BASH_SOURCE[0]}")/base-test.sh"
|
|
|
|
require_command lua
|
|
|
|
test_dir=$(mktemp -d)
|
|
trap 'rm -rf "$test_dir"' EXIT
|
|
|
|
# Load the JIS bindings on a jp layout and fire one of them in a fake window,
|
|
# printing what it hands to Hyprland. TEST_FCITX5_CONFIG is the fcitx5 config,
|
|
# or unset for none.
|
|
fire() {
|
|
local keys="$1" class="$2" tags="${3-}"
|
|
local home="$test_dir/home"
|
|
|
|
rm -rf "$home"
|
|
mkdir -p "$home/.config/fcitx5"
|
|
if [[ -v TEST_FCITX5_CONFIG ]]; then
|
|
printf '%s\n' "$TEST_FCITX5_CONFIG" >"$home/.config/fcitx5/config"
|
|
fi
|
|
|
|
if [[ ${TEST_KEYBOARD_ONLY:-false} == "true" ]]; then
|
|
printf '[Groups/0/Items/0]\nName=keyboard-us\n' > "$home/.config/fcitx5/profile"
|
|
else
|
|
printf '[Groups/0/Items/0]\nName=keyboard-us\n[Groups/0/Items/1]\nName=mozc\n' > "$home/.config/fcitx5/profile"
|
|
fi
|
|
|
|
HOME="$home" XDG_CONFIG_HOME="$home/.config" OMARCHY_PATH="$ROOT" \
|
|
TEST_KEYS="$keys" TEST_CLASS="$class" TEST_TAGS="$tags" TEST_LAYOUT="${TEST_LAYOUT:-jp}" lua <<'LUA'
|
|
package.path = os.getenv("OMARCHY_PATH") .. "/?.lua;" .. package.path
|
|
|
|
local real_open = io.open
|
|
io.open = function(path, mode)
|
|
if path == "/etc/vconsole.conf" then
|
|
local file = io.tmpfile()
|
|
file:write("XKBLAYOUT=" .. os.getenv("TEST_LAYOUT") .. "\n")
|
|
file:seek("set")
|
|
return file
|
|
end
|
|
|
|
return real_open(path, mode)
|
|
end
|
|
|
|
local binds = {}
|
|
o = {
|
|
bind = function(keys, description, dispatcher, options)
|
|
binds[keys] = { dispatcher = dispatcher, options = options or {} }
|
|
end,
|
|
}
|
|
|
|
local window = { class = os.getenv("TEST_CLASS"), tags = {} }
|
|
for tag in os.getenv("TEST_TAGS"):gmatch("[^,]+") do
|
|
table.insert(window.tags, tag)
|
|
end
|
|
|
|
hl = {
|
|
dsp = {
|
|
send_key_state = function(key)
|
|
return ("send %s %s %s"):format(key.mods, key.key, key.state)
|
|
end,
|
|
},
|
|
dispatch = function(action) print(action) end,
|
|
timer = function(callback) callback() end,
|
|
get_active_window = function() return window end,
|
|
exec_cmd = function(command) print("exec " .. command) end,
|
|
}
|
|
|
|
o.shell_succeeds = function(command) print("exec " .. command) end
|
|
|
|
require("default.hypr.bindings.input-method")
|
|
require("default.hypr.bindings.jis")
|
|
|
|
local bind = binds[os.getenv("TEST_KEYS")]
|
|
if bind.options.non_consuming then
|
|
print("non_consuming")
|
|
end
|
|
if type(bind.dispatcher) == "string" then
|
|
print("exec " .. bind.dispatcher)
|
|
else
|
|
bind.dispatcher()
|
|
end
|
|
LUA
|
|
}
|
|
|
|
assert_fires() {
|
|
local description="$1" expected="$2"
|
|
shift 2
|
|
local actual
|
|
|
|
actual=$(fire "$@")
|
|
[[ $actual == "$expected" ]] ||
|
|
fail "$description" "expected: $expected"$'\n'"actual: $actual"
|
|
pass "$description"
|
|
}
|
|
|
|
zoom="CTRL + SHIFT + semicolon"
|
|
assert_fires "the JIS + key zooms in with Ctrl + keypad plus" \
|
|
$'send CTRL KP_Add down\nsend CTRL KP_Add up' "$zoom" "chromium"
|
|
assert_fires "the JIS + key zooms in windows without a class" \
|
|
$'send CTRL KP_Add down\nsend CTRL KP_Add up' "$zoom" ""
|
|
assert_fires "the JIS + key zooms Obsidian in with Ctrl + ^" \
|
|
$'send CTRL asciicircum down\nsend CTRL asciicircum up' "$zoom" "obsidian"
|
|
assert_fires "the JIS + key zooms the Obsidian Flatpak in with Ctrl + ^" \
|
|
$'send CTRL asciicircum down\nsend CTRL asciicircum up' "$zoom" "md.obsidian.Obsidian"
|
|
|
|
# The prefix bind has to pass Ctrl + Space on, or tmux and Herdr never see it.
|
|
# Fcitx never toggles on it (configure --defaults removes it from its keys), so
|
|
# a terminal can always return to direct input first.
|
|
prefix="CTRL + SPACE"
|
|
direct=$'non_consuming\nexec timeout 0.3 fcitx5-remote --check -c'
|
|
assert_fires "the terminal prefix switches to direct input" "$direct" "$prefix" "com.mitchellh.ghostty" "terminal*"
|
|
assert_fires "the prefix leaves input alone outside terminals" "non_consuming" "$prefix" "chromium" "browser"
|
|
for layout in us kr; do
|
|
TEST_LAYOUT="$layout" assert_fires "the terminal prefix works with $layout keyboards too" "$direct" "$prefix" "foot" "terminal"
|
|
done
|
|
TEST_KEYBOARD_ONLY=true assert_fires "keyboard-only profiles use the same prefix bind" "$direct" "$prefix" "foot" "terminal"
|
|
|
|
assert_fires "Super + I cycles configured input independently of custom Fcitx keys" \
|
|
"exec omarchy-input-method cycle" "SUPER + I" "chromium"
|
|
assert_fires "Super + Shift + I cycles configured input back" \
|
|
"exec omarchy-input-method cycle back" "SUPER + SHIFT + I" "chromium"
|
|
TEST_KEYBOARD_ONLY=true assert_fires "Super + I cycles keyboard layouts without an input engine" \
|
|
"exec omarchy-input-method cycle" "SUPER + I" "foot" "terminal"
|