#!/usr/bin/env -S emacs -x ;; -*- lexical-binding: t -*- (require 'cl-lib) (require 'server) (require 'dbus) (cl-defun server-input-method-name (&optional (server "server")) (server-eval-at server 'current-input-method)) (cl-defun mozc-enabled-p (&optional (server "server")) (equal (server-input-method-name server) "japanese-mozc")) (defun fcitx5-enabled-p () (equal (dbus-call-method :session "org.fcitx.Fcitx5" "/controller" "org.fcitx.Fcitx.Controller1" "State") 2)) (princ (if (or (mozc-enabled-p) (fcitx5-enabled-p)) "あ" "A")) (terpri) ;; Local Variables: ;; flycheck-disabled-checkers: (emacs-lisp-checkdoc) ;; End: