Add a Linux version (IBus) for Bazzite / SteamOS desktop mode

linux/autozhuyin_ibus.py is an IBus engine on top of the shared Python core:
preedit with the cursor and blue English segments, lookup table, Shift tap for
English mode, candidate clicks. install.sh puts everything in the home folder
(works on read-only systems) and an autostart entry registers the engine with
ibus-daemon and selects it. Tested with a stand-in IBus module.

Also fixes Windows: wants() did not claim the backtick, so backtick + punctuation
never reached the engine under PIME.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-13 11:59:40 +08:00
co-authored by Claude Opus 5.5
parent fcc0f9d2db
commit 49e0b52fd5
10 changed files with 695 additions and 11 deletions
+2
View File
@@ -339,6 +339,8 @@ class CompositionEngine:
return False # English mode: everything goes to the app as typed
if key in SPECIAL_KEYS:
return bool(self.keys)
if key == BACKTICK:
return True
if self.keys:
return True
if key == " ":
+4
View File
@@ -105,6 +105,10 @@ class WrapperTests(unittest.TestCase):
def test_mixed_sentence(self):
self.assertEqual(type_text(self.svc, "ji3 hello world su3cl3 "), "我hello world 你好")
def test_backtick_symbol(self):
self.assertEqual(type_text(self.svc, "`<"), ",")
self.assertEqual(type_text(self.svc, "ji3`."), "我。")
def test_composition_shown(self):
type_text(self.svc, "su3c")
self.assertEqual(self.svc.reply["compositionString"], "你ㄏ")