Skip to content

Commit

Permalink
Convert preferred window-system and tty color themes into 'customize'…
Browse files Browse the repository at this point in the history
… settings
  • Loading branch information
purcell committed Jul 28, 2011
1 parent 9502556 commit fc2006e
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions init-themes.el
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
(defvar *window-system-color-theme* 'color-theme-sanityinc-solarized-dark
"Color theme to use in window-system frames")
(defvar *tty-color-theme* 'color-theme-terminal
"Color theme to use in TTY frames")
(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)
Expand All @@ -21,21 +24,21 @@
(with-selected-frame frame
(if window-system
(preserving-default-font-size
(funcall *window-system-color-theme*))
(funcall *tty-color-theme*))))
(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)
(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)
(setq window-system-color-theme 'color-theme-sanityinc-solarized-dark)
(reapply-color-themes))

(set-variable 'color-theme-is-global nil)
Expand Down

0 comments on commit fc2006e

Please sign in to comment.