-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtoggle-theme.el
More file actions
35 lines (27 loc) · 1023 Bytes
/
toggle-theme.el
File metadata and controls
35 lines (27 loc) · 1023 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
;; Author: Matthias
;; File: toggle-theme.el
;;
;; This library offers functionality to toggle between
;; a light and a dark theme.
(defgroup toggle-theme nil "The group of customizations for the toggle-theme library."
:prefix "toggle-theme/" :group 'mp)
(defcustom default-theme 'moe-light "This theme is loaded when the library is loaded.")
(defcustom light-theme 'moe-light "The standard light theme when toggling themes."
:group 'toggle-theme)
(defcustom dark-theme 'moe-dark "The standard dark theme when toggling themes."
:group 'toggle-theme)
(defvar mp/current-theme default-theme "This library keeps track of the currently loaded theme via this variable.")
(defun mp/theme-toggle ()
"Toggle between dark and light theme."
(interactive)
(let ((newtheme nil))
(if (eq light-theme mp/current-theme)
(setq newtheme dark-theme)
(setq newtheme light-theme)
)
(setq mp/current-theme newtheme)
(load-theme newtheme)
)
)
(load-theme default-theme)
(provide 'toggle-theme)