Created
September 5, 2015 22:48
-
-
Save Xparx/93dd622f65dd4be16330 to your computer and use it in GitHub Desktop.
Load emacs theme based on time when new frame is spawned
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun change-theme-on-time () | |
(destructuring-bind (sec min h m year junk junk junk junk) (decode-time (current-time))) | |
(if (or (> (string-to-number (format-time-string "%H" (current-time))) 18) | |
(< (string-to-number (format-time-string "%H" (current-time))) 9)) | |
(unless custom-enabled-themes (load-theme 'my-theme t)) (disable-theme custom-enabled-themes))) | |
(add-hook 'before-make-frame-hook 'change-theme-on-time) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment