Last active
June 8, 2017 01:44
-
-
Save joehakimrahme/6305195 to your computer and use it in GitHub Desktop.
I created this function to apply a random theme to Emacs.
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 load-random-theme () | |
"Load any random theme from the available ones." | |
(interactive) | |
;; disable any previously set theme | |
(if (boundp 'theme-of-the-day) | |
(progn | |
(disable-theme theme-of-the-day) | |
(makunbound 'theme-of-the-day))) | |
(defvar themes-list (custom-available-themes)) | |
(defvar theme-of-the-day (nth (random (length themes-list)) | |
themes-list)) | |
(load-theme (princ theme-of-the-day) t)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment