-
Notifications
You must be signed in to change notification settings - Fork 11
/
bespoke-themes.el
119 lines (104 loc) · 3.77 KB
/
bespoke-themes.el
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
;;; bespoke-themes.el --- A set of minimal and medium contrast light/dark themes
;; Copyright (C) 2020 Colin McLear
;; -------------------------------------------------------------------
;; Authors: Colin McLear
;; -------------------------------------------------------------------
;; URL: https://github.com/mclear-tools/bespoke-themes
;; -------------------------------------------------------------------
;; Created: 2021-03-16
;; Version: 0.6
;; Package-Requires: ((emacs "26.1"))
;; -------------------------------------------------------------------
;; This file is not part of GNU Emacs.
;;
;; This program is free software: you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; published by the Free Software Foundation, either version 3 of the
;; License, or (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful, but
;; WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License along with this
;; program. If not, see <http://www.gnu.org/licenses/>
;; -------------------------------------------------------------------
;;; Commentary: This theme offers a set of light/dark bespoke themes and custom mode
;; line for the discerning yak shaver. There is also an optional mode line
;; configuration, which may be used either as a header line or a foot. Options and
;; useful function below. See README for further info
;; -------------------------------------------------------------------
;;; Code:
;;
;;;; Version Requirements
(unless (>= emacs-major-version 26)
(error "Requires Emacs 26 or later"))
;;;; Theme Options
(defcustom bespoke-set-theme 'light
"Choose which theme variant, light or dark, to use."
:group 'bespoke-themes
:type 'symbol)
;; Cursors
(defcustom bespoke-set-evil-cursors t
"If t then use bespoke evil cursor colors."
:group 'bespoke-themes
:type 'boolean)
;; Font options
(defcustom bespoke-set-italic-comments t
"If t then use italics for comments."
:group 'bespoke-themes
:type 'boolean)
(defcustom bespoke-set-italic-keywords t
"If t then use italics for keywords."
:group 'bespoke-themes
:type 'boolean)
(defcustom bespoke-set-variable-pitch t
"If t then use variable-pitch for headings."
:group 'bespoke-themes
:type 'boolean)
;;;; After Load Theme Hook
(defvar bespoke-after-load-theme-hook nil
"Hook run after bespoke-theme is loaded using `load-theme'.")
;;;; Disable Theme Function
(defun bespoke--disable-all-themes ()
"Disable all active themes."
(dolist (i custom-enabled-themes)
(disable-theme i)))
;;;; Theme Toggle
;;;###autoload
(defun bespoke/toggle-theme ()
"Toggle between dark and light variants"
(interactive)
(if (eq bespoke-set-theme 'light)
(progn
(bespoke--disable-all-themes)
(setq bespoke-set-theme 'dark)
(load-theme 'bespoke t)
(run-hooks 'bespoke-after-load-theme-hook))
(progn
(bespoke--disable-all-themes)
(setq bespoke-set-theme 'light)
(load-theme 'bespoke t)
(run-hooks 'bespoke-after-load-theme-hook)
)))
;;;; Call Theme Functions
;;;###autoload
(defun bespoke/light-theme ()
"Set light variant of bespoke-theme"
(interactive)
(bespoke--disable-all-themes)
(setq bespoke-set-theme 'light)
(load-theme 'bespoke t)
(run-hooks 'bespoke-after-load-theme-hook))
;;;###autoload
(defun bespoke/dark-theme ()
"Set dark variant of bespoke-theme"
(interactive)
(bespoke--disable-all-themes)
(setq bespoke-set-theme 'dark)
(load-theme 'bespoke t)
(run-hooks 'bespoke-after-load-theme-hook))
;;; Provide Theme
(provide 'bespoke-themes)
;;; End bespoke-themes.el