Initial commit
This commit is contained in:
26
waybar/fcitx5-state.el
Executable file
26
waybar/fcitx5-state.el
Executable file
@ -0,0 +1,26 @@
|
||||
#!/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:
|
||||
Reference in New Issue
Block a user