summaryrefslogtreecommitdiff
path: root/dotfiles-darwin/emacs/functions.el
diff options
context:
space:
mode:
authorGrégoire Duchêne <gduchene@awhk.org>2025-01-11 15:49:44 +0000
committerGrégoire Duchêne <gduchene@awhk.org>2025-01-11 15:49:44 +0000
commiteca7b640967eab0806d0b5eb72983ae95b715c7a (patch)
tree91f8022afe1eba79496bd8c235925304eb702712 /dotfiles-darwin/emacs/functions.el
parent2ef6316ae717c53071ceecc6e055d890ae0a0bfb (diff)
darwin/emacs: Automatically pick and switch themes
Diffstat (limited to 'dotfiles-darwin/emacs/functions.el')
-rw-r--r--dotfiles-darwin/emacs/functions.el9
1 files changed, 9 insertions, 0 deletions
diff --git a/dotfiles-darwin/emacs/functions.el b/dotfiles-darwin/emacs/functions.el
index c9b16be..1c57e59 100644
--- a/dotfiles-darwin/emacs/functions.el
+++ b/dotfiles-darwin/emacs/functions.el
@@ -33,3 +33,12 @@
map)
t nil
"Use %k to resize the frame")))
+
+(defun my/set-frame-themes ()
+ "Configure themes, including theme switching."
+ (let ((day-theme (seq-random-elt (alist-get 'day my/themes)))
+ (night-theme (seq-random-elt (alist-get 'night my/themes))))
+ (load-theme day-theme :no-confirm :no-enable)
+ (load-theme night-theme :no-confirm :no-enable)
+ (run-at-time nil (* 15 60) #'my/maybe-switch-theme day-theme night-theme
+ #'my/macos-dark-p)))