forked from purcell/emacs.d
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinit-themes.el
45 lines (33 loc) · 1.3 KB
/
init-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
(defcustom window-system-color-theme 'color-theme-sanityinc-solarized-dark
"Color theme to use in window-system frames"
:type 'symbol)
(defcustom tty-color-theme 'color-theme-terminal
"Color theme to use in TTY frames"
:type 'symbol)
(require 'color-theme-autoloads)
(autoload 'color-theme-sanityinc-solarized-dark "color-theme-sanityinc-solarized" "A dark color theme" t)
(defun color-theme-terminal ()
(interactive)
(color-theme-sanityinc-solarized-dark))
(defun apply-best-color-theme-for-frame-type (frame)
(with-selected-frame frame
(if window-system
(preserving-default-font-size
(funcall window-system-color-theme))
(funcall tty-color-theme))))
(defun reapply-color-themes ()
(interactive)
(mapcar 'apply-best-color-theme-for-frame-type (frame-list)))
(defun light ()
(interactive)
(setq window-system-color-theme 'color-theme-sanityinc-solarized-light)
(reapply-color-themes))
(defun dark ()
(interactive)
(setq window-system-color-theme 'color-theme-sanityinc-solarized-dark)
(reapply-color-themes))
(set-variable 'color-theme-is-global nil)
(add-hook 'after-make-frame-functions 'apply-best-color-theme-for-frame-type)
(add-hook 'after-init-hook 'reapply-color-themes)
(apply-best-color-theme-for-frame-type (selected-frame))
(provide 'init-themes)