This commit is contained in:
Zelong Kuang
2026-03-20 22:04:25 +11:00
parent 570d0275f1
commit 3ca5933292
7 changed files with 107 additions and 29 deletions

View File

@@ -41,7 +41,7 @@
(use-package doric-themes
:demand t
:bind ("<f5>" . doric-load-random)
:bind ("<f5>" . doric-themes-load-random)
:bind ("C-<f5>" . doric-load-random-light)
:bind ("M-<f5>" . doric-load-random-dark)
:init
@@ -61,12 +61,20 @@
doric-coral
doric-earth
doric-almond))
(defun doric-load-random ()
(interactive)
(mapc #'disable-theme custom-enabled-themes)
(let ((loaded (seq-random-elt (append my/doric-light-themes my/doric-dark-themes))))
(defun synchronise-theme ()
(let* ((hour (string-to-number
(substring (current-time-string) 11 13)))
(theme-list (if (member hour (number-sequence 6 18))
my/doric-light-themes
my/doric-dark-themes))
(loaded (seq-random-elt theme-list)))
(mapc #'disable-theme custom-enabled-themes)
(load-theme loaded :no-confirm)))
(synchronise-theme)
(run-with-timer 3600 3600 'synchronise-theme)
(defun doric-load-random-light ()
(interactive)
(mapc #'disable-theme custom-enabled-themes)
@@ -77,8 +85,7 @@
(interactive)
(mapc #'disable-theme custom-enabled-themes)
(let ((loaded (seq-random-elt my/doric-dark-themes)))
(load-theme loaded :no-confirm)))
(doric-load-random))
(load-theme loaded :no-confirm))))
(use-package rainbow-delimiters
:hook ((prog-mode . rainbow-delimiters-mode)