From 22b60b4f3322e25cabd89bb1cdb99c66733e5f64 Mon Sep 17 00:00:00 2001 From: Jacopo De Simoi Date: Thu, 3 May 2018 11:06:17 -0400 Subject: [PATCH] Connect to indicator dbus service to change cursor color --- global.org | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/global.org b/global.org index eec9a3f..8ddbcab 100644 --- a/global.org +++ b/global.org @@ -370,6 +370,26 @@ ;; Use system proxy (setq url-proxy-services '(("http" . "127.0.0.1:8118"))) #+END_SRC +** Indicator + Change cursor color to reflect different layers on the keyboard + This is the handler + #+BEGIN_SRC emacs-lisp + (defun xkbvleds-indicator-signal-handler (indicator on) + (if on + (cond ((string-equal indicator "Greek") + (set-face-background 'cursor "#2aa198")) + ((string-equal indicator "Math") + (set-face-background 'cursor "#859900"))) + (set-face-background 'cursor "#919191"))) + #+END_SRC + Connect the signal from xkbvleds to the handler + #+BEGIN_SRC emacs-lisp + (require 'dbus) + (dbus-register-signal + :session "org.xkbvleds" "/org/xkbvleds" + "org.xkbvleds" "indicatorChanged" + 'xkbvleds-indicator-signal-handler) + #+END_SRC * Main major modes ** org-mode *** Require