Skip to content

Instantly share code, notes, and snippets.

@joehakimrahme
Last active June 8, 2017 01:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joehakimrahme/6305195 to your computer and use it in GitHub Desktop.
Save joehakimrahme/6305195 to your computer and use it in GitHub Desktop.
I created this function to apply a random theme to Emacs.
(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