From 71c2e4e9aa7798c57b4f39ab0893aa2489a159e4 Mon Sep 17 00:00:00 2001 From: octaspire Date: Fri, 25 Dec 2020 11:20:56 +0200 Subject: [PATCH] Use 'moe-theme' in both dark and light mode * Use 'moe-theme' * Toggle between light and dark mode according to an environment variable. * Change midnight colors for the 'pdf-tools' according the darkness or lightness of the mode. --- emacs/.config/emacs/init.el | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/emacs/.config/emacs/init.el b/emacs/.config/emacs/init.el index 5594389..52d8992 100644 --- a/emacs/.config/emacs/init.el +++ b/emacs/.config/emacs/init.el @@ -30,6 +30,9 @@ (package-refresh-contents) (package-install 'use-package)) +(setq octaspire/dark-mode + (getenv "OCTASPIRE_EMACS_DARK_MODE")) + ;; Package 'exec-path-from-shell' should be installed as early as possible, ;; because without it all the tests using 'executable-find' might fail to find ;; existing executables in macOS. @@ -379,8 +382,9 @@ adding it to the kill ring as a new kill." :config (progn (when (eq system-type 'darwin) (setq pdf-info-epdfinfo-program "/usr/local/bin/epdfinfo")) (pdf-tools-install) - (setq pdf-view-midnight-colors '("#000000" . "#ffffea")) - (add-hook 'pdf-view-mode-hook 'pdf-view-midnight-minor-mode) + (setq pdf-view-midnight-colors (if octaspire/dark-mode + '("#b0c09f" . "#303030") + '("#686b93" . "#fdfde7"))) (add-hook 'doc-view-mode-hook (lambda () (when (eq doc-view-doc-type 'pdf) (pdf-view-mode))))))) @@ -511,9 +515,9 @@ adding it to the kill ring as a new kill." (put 'narrow-to-region 'disabled nil) -(use-package acme-theme +(use-package moe-theme :ensure t - :config (load-theme 'acme t)) + :config (load-theme (if octaspire/dark-mode 'moe-dark 'moe-light) t)) (when (eq system-type 'darwin) (setq mac-option-key-is-meta nil -- 2.30.1