From 101160620bce8618492201426b1473bef632124a Mon Sep 17 00:00:00 2001 From: GrĂ©goire DuchĂȘne Date: Sat, 29 May 2021 17:02:18 +0100 Subject: emacs: Automatically switch themes at night --- dotfiles-darwin/emacs/init.el | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'dotfiles-darwin/emacs/init.el') 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) -- cgit v1.2.3-70-g09d2