Emacs 根据时间切换主题

根据时间,自动切换亮色和暗色主题。

(setq day-theme 'light-blue)
(setq dark-theme 'misterioso)
(defun synchronize-theme ()
    (setq hour
        (string-to-number
            (substring (current-time-string) 11 13)))
    (if (member hour (number-sequence 6 18))
        (setq now day-theme)
        (setq now dark-theme))
    (load-theme now)
)
(run-with-timer 0 3600 'synchronize-theme)

自动切换主题的包:circadian.el

Contents

0