Jousimies/.emacs.d

theme auto change

Jousimies opened this issue · 0 comments

  (defun my/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 #'my/apply-theme)
  (setq calendar-latitude 32.05
        calendar-longitude 118.77)
  (if (or sys-winp sys-linux)
      (setq circadian-themes '((:sunrise . modus-operandi)
			       (:sunset  . modus-vivendi)))
    (circadian-setup))