summaryrefslogtreecommitdiff
path: root/dotfiles-darwin
diff options
context:
space:
mode:
authorGrégoire Duchêne <gduchene@awhk.org>2021-05-29 17:02:18 +0100
committerGrégoire Duchêne <gduchene@awhk.org>2021-05-29 17:02:18 +0100
commit101160620bce8618492201426b1473bef632124a (patch)
tree431a29e2c7f0d6e469ad6fcfe650f1a84789b331 /dotfiles-darwin
parent85d34179affb18de150b99c70e91ef0787e85517 (diff)
emacs: Automatically switch themes at night
Diffstat (limited to 'dotfiles-darwin')
-rw-r--r--dotfiles-darwin/emacs/init.el8
1 files changed, 8 insertions, 0 deletions
diff --git a/dotfiles-darwin/emacs/init.el b/dotfiles-darwin/emacs/init.el
index fd37171..c4b1e07 100644
--- a/dotfiles-darwin/emacs/init.el
+++ b/dotfiles-darwin/emacs/init.el
@@ -2,3 +2,11 @@
(when (executable-find "gls")
(setq insert-directory-program "gls"))
+
+(defun is-macos-dark ()
+ (interactive)
+ (string= (shell-command-to-string "defaults read -g AppleInterfaceStyle")
+ "Dark\n"))
+
+(run-at-time nil (* 15 60) 'maybe-switch-theme 'doom-one-light 'doom-one
+ 'is-macos-dark)