Skip to content

FYI: make it work across all GUI app with fcitx5 dbus #1

@QiangF

Description

@QiangF

I find it could be possible to monitor if we are in an input field of any GUI app via fcitx5

(when (bound-and-true-p exwm-enable)
  (defvar exwm-inside-input-field nil)
  (defun exwm-input-field-entry-handler (&rest args)
    (setq exwm-inside-input-field t))
  (defun exwm-input-field-exit-handler ()
    (setq exwm-inside-input-field nil))

  (dbus-register-signal
   :session fcitx-service
   nil                                  ; PATH: Wildcard, listen on all object paths
   fcitx-ic-interface "CurrentIM"
   #'exwm-input-field-entry-handler)

  (dbus-register-signal
   :session fcitx-service
   nil
   fcitx-ic-interface "NotifyFocusOut"
   #'exwm-input-field-exit-handler))

See the whole package here https://github.com/QiangF/imbot

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions