Kaynağa Gözat

themes: Simplify, add base16

master
Bingen Eguzkitza 5 yıl önce
ebeveyn
işleme
ba8bb61c6f
1 değiştirilmiş dosya ile 12 ekleme ve 42 silme
  1. +12
    -42
      lisp/init-themes.el

+ 12
- 42
lisp/init-themes.el Dosyayı Görüntüle

@@ -1,51 +1,22 @@
;;; package --- themes
;;; Commentary:
;;; Code:

(when (< emacs-major-version 24)
(require-package 'color-theme))

(require-package 'color-theme-sanityinc-solarized)
(require-package 'color-theme-sanityinc-tomorrow)

;;------------------------------------------------------------------------------
;; Old-style color theming support (via color-theme.el)
;;------------------------------------------------------------------------------
(defcustom window-system-color-theme 'color-theme-sanityinc-solarized-dark
"Color theme to use in window-system frames.
If Emacs' native theme support is available, this setting is
ignored: use `custom-enabled-themes' instead."
:type 'symbol)

(defcustom tty-color-theme 'color-theme-terminal
"Color theme to use in TTY frames.
If Emacs' native theme support is available, this setting is
ignored: use `custom-enabled-themes' instead."
:type 'symbol)

(unless (boundp 'custom-enabled-themes)
(defun color-theme-terminal ()
(interactive)
(color-theme-sanityinc-solarized-dark))
;;(require-package 'color-theme-sanityinc-solarized)
;;(require-package 'color-theme-sanityinc-tomorrow)
(require-package 'base16-theme)

(defun apply-best-color-theme-for-frame-type (frame)
(with-selected-frame frame
(funcall (if window-system
window-system-color-theme
tty-color-theme))))
(add-to-list 'custom-theme-load-path "~/.emacs.d/themes/")

(defun reapply-color-themes ()
(interactive)
(mapcar 'apply-best-color-theme-for-frame-type (frame-list)))

(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)))


;;------------------------------------------------------------------------------
;; New-style theme support, in which per-frame theming is not possible
;;------------------------------------------------------------------------------
;; (load-theme 'tron-legacy t)
(load-theme 'base16-tomorrow t)
;; (load-theme 'base16-tomorrow-night t)

;; If you don't customize it, this is the theme you get.
(setq-default custom-enabled-themes '(sanityinc-solarized-light))
;;(setq-default custom-enabled-themes '(sanityinc-solarized-light))

;; Ensure that themes will be applied even if they have not been customized
(defun reapply-themes ()
@@ -57,7 +28,6 @@ ignored: use `custom-enabled-themes' instead."

(add-hook 'after-init-hook 'reapply-themes)


;;------------------------------------------------------------------------------
;; Toggle between light and dark
;;------------------------------------------------------------------------------

Yükleniyor…
İptal
Kaydet