light by day dark by night for solarized

This commit is contained in:
Ivan Malison 2014-10-28 15:12:59 -07:00
parent 6ced4a3bc7
commit 5629dac879

25
init.el
View File

@ -40,7 +40,7 @@
(package-initialize) (package-initialize)
(defvar my-packages (defvar my-packages
'(cl-lib ctags ctags-update flycheck ensime pymacs '(cl-lib ctags ctags-update flycheck ensime pymacs color-theme
multiple-cursors latex-preview-pane pytest epl multiple-cursors latex-preview-pane pytest epl
starter-kit-bindings zenburn-theme jedi tern starter-kit-bindings zenburn-theme jedi tern
starter-kit magit ido-ubiquitous monokai-theme starter-kit magit ido-ubiquitous monokai-theme
@ -371,10 +371,27 @@ Return a list of installed packages or nil for every package not installed."
;; Appearance ;; Appearance
;; ============================================================================= ;; =============================================================================
(defvar my-themes '(monokai solarized-dark zenburn base16-default)) ;; Choose random theme:
(defvar my-theme (nth (random (length my-themes)) my-themes)) ;; (defvar my-themes '(monokai solarized-dark zenburn base16-default))
(load-theme 'solarized-dark t) ;; (defvar my-theme (nth (random (length my-themes)) my-themes))
(defun get-appropriate-solarized-theme ()
(let ((hour
(string-to-number (format-time-string "%H"))))
(if (or (< hour 6) (> hour 20))
'solarized-dark 'solarized-light)))
(setq current-theme nil)
(defun set-solarized-theme ()
(interactive)
(let ((appropriate-theme (get-appropriate-solarized-theme)))
(if (eq appropriate-theme current-theme)
nil
(progn (load-theme appropriate-theme t)
(setq current-theme appropriate-theme)))))
(run-at-time "12:00" 3600 'set-solarized-theme)
(require 'color-theme) (require 'color-theme)
(require 'whitespace) (require 'whitespace)