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>
30 lines
1.0 KiB
Lua
30 lines
1.0 KiB
Lua
-- Same terminal tag test as clipboard.lua.
|
|
local function active_window_is_terminal()
|
|
local window = hl.get_active_window()
|
|
if not window then
|
|
return false
|
|
end
|
|
|
|
for _, tag in ipairs(window.tags or {}) do
|
|
if tag:gsub("%*$", "") == "terminal" then
|
|
return true
|
|
end
|
|
end
|
|
|
|
return false
|
|
end
|
|
|
|
-- Keep the desktop shortcut independent of Fcitx's custom switching keys.
|
|
-- Read the live Fcitx group so setup works without a compositor reload.
|
|
o.bind("SUPER + I", "Switch input language", "omarchy-input-method cycle")
|
|
o.bind("SUPER + SHIFT + I", "Switch input language back", "omarchy-input-method cycle back")
|
|
|
|
-- Pass the tmux/Herdr prefix through and return to direct input, so the next
|
|
-- key reaches the multiplexer instead of the engine's composition.
|
|
o.bind("CTRL + SPACE", "Direct input for the terminal prefix", function()
|
|
if active_window_is_terminal() then
|
|
-- Wait for the local controller reply before dispatching the next key.
|
|
o.shell_succeeds("timeout 0.3 fcitx5-remote --check -c")
|
|
end
|
|
end, { non_consuming = true })
|