mirror of
https://github.com/lilydjwg/fcitx.vim.git
synced 2025-12-27 02:24:57 +08:00
add support for fcitx5-rime
https://github.com/fcitx/fcitx5-rime/issues/30#issuecomment-957001110
This commit is contained in:
parent
c689083ffb
commit
e962387307
1 changed files with 19 additions and 1 deletions
|
|
@ -18,8 +18,26 @@ class FcitxComm():
|
|||
def deactivate(self):
|
||||
self.fcitx.Deactivate()
|
||||
|
||||
class FcitxRimeComm():
|
||||
def __init__(self):
|
||||
bus = dbus.SessionBus()
|
||||
obj = bus.get_object('org.fcitx.Fcitx5', '/rime')
|
||||
self.fcitx = dbus.Interface(obj, dbus_interface='org.fcitx.Fcitx.Rime1')
|
||||
|
||||
def status(self):
|
||||
return self.fcitx.IsAsciiMode()
|
||||
|
||||
def activate(self):
|
||||
self.fcitx.SetAsciiMode(False)
|
||||
|
||||
def deactivate(self):
|
||||
self.fcitx.SetAsciiMode(True)
|
||||
|
||||
try:
|
||||
Fcitx = FcitxComm()
|
||||
if vim.eval('get(g:, "fcitx5_rime")') == '1':
|
||||
Fcitx = FcitxRimeComm()
|
||||
else:
|
||||
Fcitx = FcitxComm()
|
||||
fcitx_loaded = True
|
||||
except dbus.exceptions.DBusException as e:
|
||||
if not vim.vars.get('silent_unsupported'):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue