Unify input methods with the installer keyboard selection

This commit is contained in:
David Heinemeier Hansson committed 2026-10-07 12:59:36 +02:00
1 parent 402128b6a2
commit 9fe6a04715
34 files changed
+1207 -31

No files matched your search

+4
View File
@@ -34,7 +34,11 @@ eza
fakeroot
fastfetch
fcitx5
fcitx5-chewing
fcitx5-chinese-addons
fcitx5-gtk
fcitx5-hangul
fcitx5-mozc
fcitx5-qt
fd
ffmpeg
+23 -4
View File
@@ -18,7 +18,8 @@
# so it never reaches the shell as SIGINT. Act on the status, never on a trap.
#
# Callers supply `notice <message> <seconds>` for validation feedback, and set
# the variables these prompts write: keyboard, keyboard_label, username,
# the variables these prompts write: keyboard, keyboard_label,
# keyboard_input_method, keyboard_xkb_layout, username,
# password, password_confirmation, full_name, email_address, hostname, timezone.
OMARCHY_FORM_BACK=1
@@ -37,6 +38,8 @@ Azerbaijani|azerty
Belarusian|by
Belgian|be-latin1
Bulgarian|bg-cp1251
Chinese (Simplified, Pinyin)|us|pinyin
Chinese (Traditional, Zhuyin)|us|chewing
Croatian|croat
Czech|cz
Danish|dk-latin1
@@ -55,8 +58,10 @@ Hungarian|hu
Icelandic|is-latin1
Irish|ie
Italian|it
Japanese|jp106
Japanese|jp106|mozc
Japanese (US keyboard)|us|mozc
Kazakh|kazakh
Korean|us|hangul|kr
Kyrgyz|kyrgyz
Lao|la-latin1
Latvian|lv
@@ -97,8 +102,22 @@ omarchy_prompt_keyboard() {
gum choose --height 10 --selected "English (US)" --header "Select keyboard layout") && status=0 || status=$?
((status == 0)) || return $status
keyboard_label="$choice"
keyboard=$(printf '%s\n' "$OMARCHY_KEYBOARD_LAYOUTS" | awk -F'|' -v c="$choice" '$1==c{print $2; exit}')
local selection
selection=$(printf '%s\n' "$OMARCHY_KEYBOARD_LAYOUTS" | awk -F'|' -v c="$choice" '$1==c{print; exit}')
[[ -n $selection ]] || return 1
IFS='|' read -r keyboard_label keyboard keyboard_input_method keyboard_xkb_layout <<< "$selection"
keyboard_input_method=${keyboard_input_method:-none}
keyboard_xkb_layout=${keyboard_xkb_layout:-}
}
# Root-side persistence. Console keymaps remain real keymaps; the input
# preference survives separately for every user of the installed system.
omarchy_persist_input_selection() {
local target_root=${1:-} method=${keyboard_input_method:-none} layout=${keyboard_xkb_layout:-}
case "$method" in none | mozc | hangul | pinyin | chewing) ;; *) return 1 ;; esac
case "$layout" in "" | kr) ;; *) return 1 ;; esac
mkdir -p "$target_root/etc/omarchy"
printf 'INPUT_METHOD=%s\nXKB_LAYOUT=%s\n' "$method" "$layout" > "$target_root/etc/omarchy/input-method"
}
omarchy_prompt_username() {
+1
View File
@@ -2,6 +2,7 @@ run_logged "$OMARCHY_INSTALL/user/theme.sh"
run_logged "$OMARCHY_INSTALL/user/chromium.sh"
run_logged "$OMARCHY_INSTALL/user/git.sh"
run_logged "$OMARCHY_INSTALL/user/xcompose.sh"
run_logged "$OMARCHY_INSTALL/user/input-method.sh"
run_logged "$OMARCHY_INSTALL/user/mise-work.sh"
run_logged "$OMARCHY_INSTALL/user/hardware/asus/fix-audio-mixer.sh"
@@ -11,6 +11,8 @@
set -euo pipefail
omarchy-input-method configure --defaults || echo "Input method defaults deferred; run omarchy setup input after login." >&2
systemctl --user daemon-reload
systemctl --user enable --now \
bt-agent.service \
+1
View File
@@ -0,0 +1 @@
omarchy-input-method configure --seed