Repository navigation
Design decisions
Mike edited this page Oct 1, 2026
·
2 revisions
The decisions behind the project and their reasons. Scope is in the README; how the parts work is in How it works.
- The macOS rule. In a password field only Latin layouts are allowed: a Latin layout stays, otherwise the last used Latin one is switched to, and the previous layout comes back afterwards. People who switch from macOS already know it, and it never changes a layout that can already type the password.
- Two sources, because the signals differ. Terminals tell nobody about a password prompt; only the pseudo-terminal's mode shows it ("echo off, line input on"). Graphical applications do tell the input method that a field is for a password, the same fact macOS acts on, so fcitx5, which Omarchy already runs, is where to listen. Zen and Chromium both set that mark, so no browser extension is needed.
-
One shared state. The service and the addon are separate processes, so
who holds Latin and the layout to restore are kept in a file under
$XDG_RUNTIME_DIR.enter/leaveexpose the same state to scripts. -
Hyprland keeps the layouts. Layouts stay in
kb_layout; switching goes throughswitchxkblayout all, because with fcitx5 runningcurrenthits the wrong device. - C++20, no libraries. The service runs all the time, so memory and wakeups matter, and the fcitx5 addon has to be C++ anyway and links the same code. Which layouts are Latin is measured once with libxkbcommon and kept as tables (why).
- Wake on output, not on a timer. The service sleeps until inotify reports that a terminal printed, checks only those terminals, and polls only while a prompt is up (costs).
- Any terminal emulator. A prompt counts if a process on that terminal descends from the focused window's process; there is no list of terminals. tmux is asked which pane is visible.
- Nothing on fcitx5's thread. Every key press goes through it, so the addon hands the switch to a worker thread that applies only the latest wish; a slow compositor cannot delay typing.
-
The package changes nothing by itself. Like other Arch packages it
enables and restarts nothing; it prints what to run, and
password-layout doctorsays what is missing.