13929cb23806419d948068e5e58cbf39cbf8010a
[~bandali/configs] / .emacs.d / 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 (with-eval-after-load 'package
28 (require 'refinery-theme)
29 (load-theme 'refinery t))
30
31 ;; (require 'smart-mode-line)
32 ;; ;; thanks, but no thanks; don't make fixed-width fills.
33 ;; (defun sml/fill-for-buffer-identification nil "")
34 ;; (setq sml/theme 'respectful)
35 ;; (let ((sml/no-confirm-load-theme t))
36 ;; (sml/setup)
37 ;; (smart-mode-line-enable))
38
39 ;; (require 'minions)
40 ;; (minions-mode)
41
42 (defvar b/org-mode-font-lock-keywords
43 '(("[ \t]*\\(#\\+\\(BEGIN\\|END\\|begin\\|end\\)_\\(\\S-+\\)\\)[ \t]*\\([^\n:]*\\)"
44 (1 '(:foreground "#5a5b5a" :background "#292b2b") t) ; directive
45 (3 '(:foreground "#81a2be" :background "#292b2b") t) ; kind
46 (4 '(:foreground "#c5c8c6") t))) ; title
47 "For use with the `doom-tomorrow-night' theme.")
48
49 (eval-when-compile
50 (declare-function exwm-systemtray--refresh "exwm-systemtray")
51 (declare-function erc-hl-nicks-reset-face-table "erc-hl-nicks"))
52
53 (defun b/lights-on ()
54 "Enable my favourite light theme."
55 (interactive)
56 (mapc #'disable-theme custom-enabled-themes)
57 (load-theme 'refinery t)
58 (when (featurep 'smart-mode-line)
59 (let ((sml/no-confirm-load-theme t))
60 (sml/apply-theme 'respectful)))
61 (font-lock-remove-keywords
62 'org-mode b/org-mode-font-lock-keywords)
63 (when (featurep 'erc-hl-nicks)
64 (erc-hl-nicks-reset-face-table))
65 (when (featurep 'exwm-systemtray)
66 (exwm-systemtray--refresh)))
67
68 (defun b/lights-off ()
69 "Go dark."
70 (interactive)
71 (mapc #'disable-theme custom-enabled-themes)
72 (load-theme 'refinery-dark t)
73 (when (featurep 'smart-mode-line)
74 (let ((sml/no-confirm-load-theme t))
75 (sml/apply-theme 'dark)))
76 (font-lock-add-keywords
77 'org-mode b/org-mode-font-lock-keywords t)
78 (when (featurep 'erc-hl-nicks)
79 (erc-hl-nicks-reset-face-table))
80 (when (featurep 'exwm-systemtray)
81 (exwm-systemtray--refresh)))
82
83 (global-set-key (kbd "C-c t d") #'b/lights-off)
84 (global-set-key (kbd "C-c t l") #'b/lights-on)
85
86 (provide 'bandali-theme)
87 ;;; bandali-theme.el ends here