From c8c0e93ad9224f46fa959b9e113625611997cd1a Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Sat, 11 Sep 2021 15:39:09 +0100 Subject: Add mac configuration with theme --- doom/config.el | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'doom') diff --git a/doom/config.el b/doom/config.el index 18b6d6c..7f49356 100644 --- a/doom/config.el +++ b/doom/config.el @@ -99,11 +99,20 @@ ;; Mac configuration (when (eq system-type 'darwin) - (setq mac-right-option-modifier 'none - mac-option-key-is-meta nil - mac-command-key-is-meta t - mac-command-modifier 'meta - mac-option-modifier nil)) + (progn (setq mac-right-option-modifier 'none + mac-option-key-is-meta nil + mac-command-key-is-meta t + mac-command-modifier 'meta + mac-option-modifier nil) + + (defun ymhg/apply-theme (appearance) + "Load theme, taking current system APPEARANCE into consideration." + (mapc #'disable-theme custom-enabled-themes) + (pcase appearance + ('light (load-theme 'modus-operandi t)) + ('dark (load-theme 'modus-vivendi t)))) + + (add-hook 'ns-system-appearance-change-functions #'ymhg/apply-theme))) (defun y/insert-date () "Insert a timestamp according to locale's date and time format." -- cgit