summaryrefslogtreecommitdiff
path: root/.config/emacs/modules/bd--themes.el
blob: ddcfcf265ef5d1523ec310daa6d4b7311996d8f3 (plain)
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
;;; -*- lexical-binding: t; -*-
;;; Commentary:
;;; Code:


(defun bd/enable-variable-pitch-exempt ()
  "Text modes to exempt from variable pitch fonts."
  (unless (derived-mode-p 'latex-mode 'mhtml-mode 'nxml-mode 'yaml-mode)
    (variable-pitch-mode 1)))

(defvar bd/enable-variable-pitch-in-hooks
  '(text-mode-hook)
  "List of hook symbols to add `variable-pitch-mode'
to.")

(mapc
 (lambda (hook)
   (add-hook hook #'bd/enable-variable-pitch-exempt))
 bd/enable-variable-pitch-in-hooks)

(set-face-attribute 'variable-pitch nil
                    :family "Dejavu Math TeX Gyre"
                    :height 110)
(set-face-attribute 'fixed-pitch nil
                    :family "Terminus"
                    :height 110)
(set-face-attribute 'default nil
                    :family "Terminus"
                    :height 140)


(use-package modus-themes
  :load-path (lambda () (expand-file-name "themes/" data-directory))
  :demand t
  :config
  ;; Disable all other themes to avoid awkward blending:
  (mapc #'disable-theme custom-enabled-themes)
  (defun bd/modus-set-faces (&rest _)
    "Blends the modeline with the echo area,
and some other minor face changes."
    (modus-themes-with-colors
      (custom-set-faces
       `(mode-line ((,c :overline ,keyword)))
       `(mode-line-inactive ((,c :overline ,bg-button-inactive)))
       `(eshell-prompt ((,c :foreground ,fg-main :background ,bg-dim :height 1.1 :extend t))))))
  (add-hook 'modus-themes-post-load-hook #'bd/modus-set-faces)
  
  (setopt modus-themes-to-toggle '(modus-operandi-tinted modus-vivendi-tinted)
	  modus-themes-mixed-fonts t
	  modus-themes-italic-constructs t
	  modus-themes-bold-constructs t
	  modus-themes-variable-pitch-ui nil
	  modus-themes-headings
	  '((0 variable-pitch bold 1.5)
	    (1 variable-pitch bold 1.4)
	    (2 variable-pitch regular 1.3)
	    (3 variable-pitch regular 1.1)
	    (t variable-pitch regular 1.0))

	  modus-themes-common-palette-overrides
	  '((bg-mode-line-active bg-main)
	    (bg-mode-line-inactive bg-main)
	    (border-mode-line-active bg-main)
	    (border-mode-line-inactive bg-main)
	    (bg-line-number-active bg-dim)
	    (bg-line-number-inactive bg-dim)
	    (fg-heading-1 fg-term-blue-bright)
	    (fg-heading-2 fg-term-magenta-bright)
	    (bg-tab-bar bg-main)
	    (bg-tab-current bg-main)
	    (bg-tab-other bg-button-inactive))))

(load-theme 'modus-vivendi-tinted :no-confirm)
(run-hooks 'modus-themes-post-load-hook)


(provide 'bd--themes)
;;; bd--themes.el ends here