From aba444b82b886a5883d63c111d108974dbf22879 Mon Sep 17 00:00:00 2001 From: Grégoire Duchêne Date: Sun, 4 Jul 2021 13:12:51 +0100 Subject: emacs: Parameterize theme selection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also, set the timer running ‘is-macos-dark’ (renamed to ‘macos-dark-p’) only when ‘after-init-hook’ is run. This makes it so that the correct themes will be used when ‘awhk-day-theme’ and ‘awhk-night-theme’ are changed in per-domain or per-host configuration. --- emacs/init.el | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'emacs/init.el') diff --git a/emacs/init.el b/emacs/init.el index 29c71cc..f106492 100644 --- a/emacs/init.el +++ b/emacs/init.el @@ -55,6 +55,10 @@ (blink-cursor-mode -1) (scroll-bar-mode -1)) +(defvar awhk-day-theme nil "Theme to use during the day.") + +(defvar awhk-night-theme nil "Theme to use during the night.") + (use-package bazel :config (setq bazel-buildifier-before-save t) :ensure t) @@ -74,13 +78,15 @@ (use-package doom-themes :config - (setq doom-themes-enable-bold t + (setq awhk-day-theme 'doom-one-light + awhk-night-theme 'doom-one + doom-themes-enable-bold t doom-themes-enable-italic t) (add-to-list 'doom-themes-base-faces '(nobreak-space :inherit 'default :underline builtin) t) - (load-theme 'doom-one 'no-confirm 'no-load) - (load-theme 'doom-one-light 'no-confirm 'no-load) + (load-theme 'doom-one 'no-confirm 'no-enable) + (load-theme 'doom-one-light 'no-confirm 'no-enable) :ensure t) (use-package exec-path-from-shell -- cgit v1.2.3-70-g09d2