diff --git a/bin/omarchy-menu-keybindings b/bin/omarchy-menu-keybindings index 153a4d29..1d00e5f5 100755 --- a/bin/omarchy-menu-keybindings +++ b/bin/omarchy-menu-keybindings @@ -332,6 +332,7 @@ dynamic_bindings() { static_bindings() { echo "SHIFT ALT,L,Copy URL from Web App,sendshortcut,SHIFT ALT,L," echo "SHIFT ALT,D,Download Video from Web App,sendshortcut,SHIFT ALT,D," + echo "CTRL SHIFT,SPACE,Switch input language,exec,fcitx5-remote -t" } # Actions Omarchy binds to a second chord meant as an alternative, named one at @@ -533,7 +534,7 @@ output_binding_records_uncached() { keybindings_cache_key() { { - printf 'v14\n' + printf 'v15\n' hyprctl devices 2>/dev/null | grep -F 'active keymap:' hyprctl binds 2>/dev/null } | sha256sum | awk '{ print $1 }' diff --git a/shell/plugins/bar/widgets/KeyboardLayoutModel.js b/shell/plugins/bar/widgets/KeyboardLayoutModel.js index 69ece973..b1ee1cf8 100644 --- a/shell/plugins/bar/widgets/KeyboardLayoutModel.js +++ b/shell/plugins/bar/widgets/KeyboardLayoutModel.js @@ -120,7 +120,7 @@ function inputLabel(state, fallback) { function inputTooltip(state, layout, multipleLayouts) { if (!state || !state.methods || state.methods.length < 2) return layout + (multipleLayouts ? "" : "\nClick to set up an input language") - var text = state.name + "\nClick to switch input language" + var text = state.name + "\nClick to switch input language\nCtrl + Shift + Space to toggle input" if (state.methods.indexOf("mozc") !== -1) text += "\nJapanese: type a word, then Space twice for character choices" if (multipleLayouts) text += "\nRight-click to switch keyboard layout" diff --git a/test/shell.d/keybindings-menu-test.sh b/test/shell.d/keybindings-menu-test.sh index 5f962e6a..f5a06906 100755 --- a/test/shell.d/keybindings-menu-test.sh +++ b/test/shell.d/keybindings-menu-test.sh @@ -64,6 +64,9 @@ rendered=$(keybindings) grep -q 'SUPER + F *→ Full screen' <<<"$rendered" || fail "a chord with no alternative renders on its own" "$rendered" pass "the keybindings menu renders its entries" +grep -q 'CTRL SHIFT + SPACE *→ Switch input language' <<<"$rendered" || + fail "the input switch shortcut appears in the cheatsheet" "$rendered" +pass "the input switch shortcut appears in the cheatsheet" (( $(grep -c '→ Close window$' <<<"$rendered") == 1 )) || fail "an alternative chord joins the row of the first one" "$rendered" diff --git a/test/shell.d/keyboard-layout-test.sh b/test/shell.d/keyboard-layout-test.sh index a2181b1b..07469343 100755 --- a/test/shell.d/keyboard-layout-test.sh +++ b/test/shell.d/keyboard-layout-test.sh @@ -15,6 +15,7 @@ assertEqual(model.inputLabel({}, 'EN'), 'EN', 'a stopped input service retains t assertEqual(model.inputLabel({ current: 'hangul' }, 'EN'), '한', 'Korean input has a distinct label') assertEqual(model.inputLabel({ current: 'custom', language: 'vi' }, 'EN'), 'VI', 'other engines use their reported language') assertEqual(model.inputTooltip(japanese, 'English (US)', false).includes('Space twice'), true, 'Japanese explains character choices') +assertEqual(model.inputTooltip(japanese, 'English (US)', false).includes('Ctrl + Shift + Space'), true, 'the input toggle shortcut is discoverable') assertEqual(model.inputTooltip(japanese, 'English (US)', true).includes('Right-click'), true, 'combined input and layout switching stays discoverable') assertEqual(model.inputTooltip({ methods: ['keyboard-fr'] }, 'French', false), 'French\nClick to set up an input language', 'one foreign mode offers input setup') assertEqual(model.showIndicator('EN', false, false), false, 'English alone stays hidden')