Skip to content

Instantly share code, notes, and snippets.

@Xparx
Created September 5, 2015 22:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Xparx/93dd622f65dd4be16330 to your computer and use it in GitHub Desktop.
Save Xparx/93dd622f65dd4be16330 to your computer and use it in GitHub Desktop.
Load emacs theme based on time when new frame is spawned
(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