parasurv's webspace

Change Emacs theme depending on time

I found this totally random one evening. With a few lines you can change themes at certain times of day.

Put this into your config file:

(load-theme 'modus-operandi t t) ;;load the theme
(run-at-time "05:00" (* 60 60 24) (lambda () (enable-theme 'modus-operandi)))

In the first line you load the theme.

In the second line you give the time in 24 hour format when you want to change that theme.

You can use it as frequently as you want. For theme change you don't need to restart Emacs, it will be automatic.

This can be used to change to darker themes for the evening, and other reminder.

Back to Emacs journal