all repos — nixfiles @ fc451064dc7ed8237864ad186353f0eaaf1dd84e

System and user configuration, managed by nix and home-manager

Emacs: fix dark/light auto-switching

Alan Pearce
commit

fc451064dc7ed8237864ad186353f0eaaf1dd84e

parent

b40e77b6501150cbab8805447a02d4bc8eb0814f

1 file changed, 3 insertions(+), 3 deletions(-)

jump to
M user/emacs/init.eluser/emacs/init.el
@@ -76,10 +76,11 @@ (let ((light-mode-theme 'modus-operandi)
(dark-mode-theme 'spacemacs-dark)) (defun my/set-dark-or-light-theme () (let ((appearance (plist-get (mac-application-state) :appearance))) + (mapc #'disable-theme custom-enabled-themes) (cond ((equal appearance "NSAppearanceNameAqua") - (counsel-load-theme light-mode-theme t)) + (load-theme light-mode-theme t)) ((equal appearance "NSAppearanceNameDarkAqua") - (counsel-load-theme dark-mode-theme t))))) + (load-theme dark-mode-theme t))))) (add-hook 'mac-effective-appearance-change-hook #'my/set-dark-or-light-theme) (if (boundp 'mac-effective-appearance-change-hook) (my/set-dark-or-light-theme)
@@ -253,7 +254,6 @@ (use-package amx
:config (setq amx-history-length 100)) (use-package counsel - :functions (counsel-load-theme) :commands (counsel-unicode-char) :general ("M-x" #'counsel-M-x))