The Complete Computing Environment

Toggle Bright/Dark Theme in Emacs, KDE and FireFox



Make my computer match my working environment, Themeing my Emacs depending on whether I am working in our basement at night or out in the park, or even just sitting in front of my sun-side window. Eventually want to integrate this with Code Surfing Mode, they seem related… This should be one of my Dipswitches, bound to <SPC>tn

Those code could really use a re-factor already, and I just wrote it! toggles like this are such a pain to build, I'm not sure why…

(provide 'cce/toggle-theme)
(setq cce/light-theme 'ef-cyprus)
(setq cce/dark-theme 'ef-bio)
(defun cce/switch-dark-theme ()
  "Enable dark theme in Firefox, KDE and Emacs"
  (disable-theme cce/light-theme)
  (enable-theme cce/dark-theme)
    (call-process-shell-command "lookandfeeltool -a 'garden.arcology.arroyo.bismuth'")
    ;; (cce/toggle-firefox-darkreader)

(defun cce/switch-light-theme ()
  "Enable light theme in Firefox, KDE and Emacs at once"
  (disable-theme cce/dark-theme)
  (enable-theme cce/light-theme)
    (call-process-shell-command "lookandfeeltool -a 'garden.arcology.arroyo.bismuth.light'")
    ;; (cce/toggle-firefox-darkreader)

(defun cce/toggle-firefox-darkreader ()
  (with-current-buffer (first (seq-filter
                               (lambda (buf)
                                 (s-starts-with? "Firefox:" (buffer-name buf)))
    (with-selected-window (get-buffer-window)
      (exwm-input--fake-key (aref (kbd "M-S-d") 0)))))

(defun cce/toggle-theme ()
  (let ((active-theme (car custom-enabled-themes)))
     ((eq active-theme cce/light-theme)
     ((eq active-theme cce/dark-theme)