- 环境 deepin linux 输入法 fcitx
- fcitx 设置 Lshift 切换输入法
- 功能: 空格后自动切换成英文输入法
(defun get-previous-char ()
  (let ((x (point)))
    (if (equal 1 x)
        nil
      (buffer-substring (1- x) x))))
(defun call-fcitx-method (method)
  (dbus-call-method
   :session
   "org.fcitx.Fcitx"
   "/inputmethod"
   "org.fcitx.Fcitx.InputMethod"
   method))
(add-hook 'post-command-hook
          (lambda ()
            (and (equal " " (get-previous-char))
                 (equal "chineseime" (call-fcitx-method "GetCurrentIM"))
                 (call-fcitx-method "InactivateIM"))))
PS: 我在电脑上只用86五笔打单字,不需要词库,而且习惯了 windows 上搜狗的 shift 切换中英文