Add and use my new Refinery colour theme
[~bandali/configs] / lisp / bandali-theme.el
1 ;;; bandali-theme.el --- bandali's custom theme setup -*- lexical-binding: t; -*-
2
3 ;; Copyright (C) 2018-2020 Amin Bandali
4
5 ;; Author: Amin Bandali <bandali@gnu.org>
6 ;; Keywords: faces
7
8 ;; This program is free software; you can redistribute it and/or modify
9 ;; it under the terms of the GNU General Public License as published by
10 ;; the Free Software Foundation, either version 3 of the License, or
11 ;; (at your option) any later version.
12
13 ;; This program is distributed in the hope that it will be useful,
14 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;; GNU General Public License for more details.
17
18 ;; You should have received a copy of the GNU General Public License
19 ;; along with this program. If not, see <https://www.gnu.org/licenses/>.
20
21 ;;; Commentary:
22
23 ;; My custom theme setup.
24
25 ;;; Code:
26
27 (add-to-list
28 'custom-theme-load-path
29 (expand-file-name
30 (convert-standard-filename "lisp") user-emacs-directory))
31
32 (use-package refinery-theme
33 :demand
34 :config
35 (load-theme 'refinery t))
36
37 (use-package smart-mode-line
38 :commands (sml/apply-theme)
39 :demand
40 :config
41 ;; thanks, but no thnaks; don't make fixed-width fills.
42 (defun sml/fill-for-buffer-identification () "")
43 (setq sml/theme 'bandali)
44 (sml/setup)
45 (smart-mode-line-enable))
46
47 (use-package minions
48 :demand
49 :config (minions-mode))
50
51 (defvar b/org-mode-font-lock-keywords
52 '(("[ \t]*\\(#\\+\\(BEGIN\\|END\\|begin\\|end\\)_\\(\\S-+\\)\\)[ \t]*\\([^\n:]*\\)"
53 (1 '(:foreground "#5a5b5a" :background "#292b2b") t) ; directive
54 (3 '(:foreground "#81a2be" :background "#292b2b") t) ; kind
55 (4 '(:foreground "#c5c8c6") t))) ; title
56 "For use with the `doom-tomorrow-night' theme.")
57
58 (eval-when-compile
59 (declare-function exwm-systemtray--refresh "exwm-systemtray"))
60
61 (defun b/lights-on ()
62 "Enable my favourite light theme."
63 (interactive)
64 (mapc #'disable-theme custom-enabled-themes)
65 (load-theme 'refinery t)
66 (when (featurep 'smart-mode-line)
67 (sml/apply-theme 'bandali))
68 (font-lock-remove-keywords
69 'org-mode b/org-mode-font-lock-keywords)
70 (when (featurep 'erc-hl-nicks)
71 (erc-hl-nicks-reset-face-table))
72 (when (featurep 'exwm-systemtray)
73 (exwm-systemtray--refresh)))
74
75 (defun b/lights-off ()
76 "Go dark."
77 (interactive)
78 (mapc #'disable-theme custom-enabled-themes)
79 (load-theme 'tango-dark t)
80 (when (featurep 'smart-mode-line)
81 (sml/apply-theme 'automatic))
82 (font-lock-add-keywords
83 'org-mode b/org-mode-font-lock-keywords t)
84 (when (featurep 'erc-hl-nicks)
85 (erc-hl-nicks-reset-face-table))
86 (when (featurep 'exwm-systemtray)
87 (exwm-systemtray--refresh)))
88
89 (bind-keys
90 ("C-c t d" . b/lights-off)
91 ("C-c t l" . b/lights-on))
92
93 (provide 'bandali-theme)
94 ;;; bandali-theme.el ends here