Files
river-config/waybar/fcitx5-state.el
2025-11-28 16:44:06 -08:00

27 lines
696 B
EmacsLisp
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/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))
""
""))
(terpri)
;; Local Variables:
;; flycheck-disabled-checkers: (emacs-lisp-checkdoc)
;; End: