Repository navigation
Description
Problem
With a Japanese input method, the input source widget shows JA whatever the mode: Hiragana, Katakana, Romaji, full-width Romaji and half-width Katakana all look the same. The mode decides what the next key types, so the bar can't tell you that. The macOS menu bar shows it with an icon (あ, ア, A…), but it's hidden when StableBar replaces it.
Other input methods with modes have the same problem, such as Chinese (Pinyin, Wubi, Zhuyin…), Korean or Tamil.
StableBar 0.20.0, macOS 27.2.
Proposal
A label setting on the inputSource provider:
language(default): today's behavior,FR,JA…icon: the icon the Input menu shows for the selected source, fromkTISPropertyIconImageURL, tinted like a symbol when it's a gray mask, as Apple's icons are. If the declared file is missing, it tries other extensions, asTextInputSources.hrecommends (Korean declares.pngfiles it ships as.tiff). When macOS has no icon file for the source, the widget shows the language, as withlanguage. That's the case for keyboard layouts and for Vietnamese. With an icon, the provider'stextis the source's name, so VoiceOver reads "Hiragana" instead ofJA.
It's editable under Show in the widget's Content tab. The provider output also gets fields.mode (the input mode ID), fields.image (the icon's path) and fields.label, so custom layouts can use them.
One open question: keyboard layouts and Vietnamese only get their real icon (such as the CH badge for Swiss French) through undocumented TIS properties, kTISPropertyInputSourceIconLabels and kTISPropertyIconImage. I left them out because of the private API rule in AGENTS.md, but they would give every source the Input menu's look. Would you accept them in PrivateAPI.swift?
I have an implementation on a branch of my fork: the setting, the picker in Settings, the schema, the docs, tests and two scenes. I can open the PR if this works for you.
Possible today
Partly, with a custom layout on the widget: a text block per mode with showWhen on fields.id (…RomajiTyping.Japanese shows あ, …Japanese.Katakana shows ア), and the text field hidden for those IDs. It works, but it needs one block per mode and per input method, and it only gives text, not the Input menu's icons.
Related
- Show the keyboard input source and switch it on click #216 added the widget. Its proposal already suggested the source's icon from
kTISPropertyIconImageURL. - Input source widget does not reflect the selected keyboard layout after switching #756 mentions that French and Swiss French both show
FR. This doesn't change that: keyboard layouts have no public icon (see the open question above).
Triaged by Claude Code via T3 Code (Claude Opus 5.5).
Activity