Connect to indicator dbus service to change cursor color

master
Jacopo De Simoi 8 years ago
parent fa8a63b5b4
commit 22b60b4f33
  1. 20
      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

Loading…
Cancel
Save