Remove dash dep - add backgroud flip command

This commit is contained in:
Kevin Cotugno 2017-06-01 10:40:42 -07:00
parent abe0dc5aa1
commit dc7c1fa3a0

View File

@ -87,21 +87,38 @@
;; Plugins ;; Plugins
;; Themes ;; Themes
(use-package dash)
(-each (defun flip-background ()
(-map "Flip the frame and terminal background mode.
(lambda (item) useful for alternating between light and dark themes"
(format "~/.emacs.d/themes/%s" item)) (interactive)
(-remove (let ((mode (if (or (eq (frame-parameter nil 'background-mode) 'dark)
(lambda (item) (or (string= item ".") (string= item ".."))) (eq (terminal-parameter nil 'background-mode) 'dark))
(directory-files ".emacs.d/themes/"))) (setq mode 'light)
(lambda (item) (setq mode 'dark))))
(add-to-list 'custom-theme-load-path item))) (set-frame-parameter nil 'background-mode mode)
(set-terminal-parameter nil 'background-mode mode)
(dolist (theme custom-enabled-themes)
(enable-theme theme))))
(load-theme 'solarized t) (global-set-key (kbd "<f5>") 'flip-background)
(set-frame-parameter nil 'background-mode 'dark)
(enable-theme 'solarized) ;; Load directories in the .emacs.d/themes directory to the load path
;; TODO Only add directories
(mapcar (lambda (item)
(add-to-list 'custom-theme-load-path item))
(mapcar (lambda (item)
(format "%s/.emacs.d/themes/%s/" (getenv "HOME") item))
(let (files '())
(dolist (val
(directory-files (format "%s/.emacs.d/themes/"
(getenv "HOME")))
files)
(let ((off (string-match "\\." val)))
(unless (and off (eq off 0))
(setq files (cons val files))))))))
(when (load-theme 'solarized t) (flip-background))
;; End themes ;; End themes