From c30e1f28e12ea06c67e6b5044392a92731be2865 Mon Sep 17 00:00:00 2001 From: larstvei Date: Sun, 11 Jun 2023 00:13:31 +0200 Subject: [PATCH] Load theme according to system appearance --- init.org | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/init.org b/init.org index 54734ef..a7e2898 100644 --- a/init.org +++ b/init.org @@ -395,11 +395,20 @@ ** Visual - I am using a lot from [[https://github.com/rougier/nano-emacs][rougier's N Λ N O Emacs]], starting with the theme. + I am using a lot from [[https://github.com/rougier/nano-emacs][rougier's N Λ N O Emacs]], starting with the theme. For + the white theme, I keep the light background toned down a touch. #+BEGIN_SRC emacs-lisp (setq nano-light-background "#fafafa") - (load-theme 'nano-light t) + #+END_SRC + + The theme is set according to the system appearance (on macOS) if that is + available, defaulting to a light theme. + + #+BEGIN_SRC emacs-lisp + (let* ((variant (if (boundp 'ns-system-appearance) ns-system-appearance 'light)) + (theme (intern (concat "nano-" (symbol-name variant))))) + (load-theme theme t)) #+END_SRC This is the default setup for [[https://github.com/rougier/nano-modeline][N Λ N O Modeline]] after version 1.0.0: