The Complete Computer

Toggle Bright/Dark Theme in Emacs, KDE and FireFox

LifeTechEmacsArcology
#+ARROYO_MODULE_WANTS: cce/appearance.org #+ARROYO_MODULE_WANTS: cce/exwm.org

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...

#+beginsrc emacs-lisp :tangle toggle-theme.el :mkdirp yes :results none (provide 'cce/toggle-theme) (setq cce/light-theme 'ef-elea-light) (setq cce/dark-theme 'ef-bio) (defun cce/switch-dark-theme () "Enable dark theme in Firefox, KDE and Emacs" (interactive) (disable-theme cce/light-theme) (enable-theme cce/dark-theme) (save-excursion ;; (call-process-shell-command "lookandfeeltool -a 'garden.arcology.arroyo.bismuth'") (call-process-shell-command "lookandfeeltool -a 'org.kde.breezedark.desktop'") ;; (cce/toggle-firefox-darkreader) ))

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

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

(defun cce/toggle-theme () (interactive) (let ((active-theme (car custom-enabled-themes))) (cond ((eq active-theme cce/light-theme) (cce/switch-dark-theme)) ((eq active-theme cce/dark-theme) (cce/switch-light-theme)))) (cce-update-org-todo-keyword-faces)) #+ENDSRC

NEXT move the look-and-feel themes int o code control

[rrix@virtuous-cassette:~/org/arcology-django]$ find ~ -name "garden.arcology.arroyo.*" home/rrix.local/share/plasma/look-and-feel/garden.arcology.arroyo.bismuth.light home/rrix.local/share/plasma/look-and-feel/garden.arcology.arroyo.bismuth