conf-theme.el 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. ;; Load path them
  2. (require 's)
  3. (require 'dash)
  4. (-each
  5. (-map
  6. (lambda (item)
  7. (format "~/.emacs.d/themes/" item))
  8. (-filter
  9. (lambda (item) (s-contains? "theme" item))
  10. (directory-files "~/.emacs.d/themes/")))
  11. (lambda (item)
  12. (add-to-list 'custom-theme-load-path item)))
  13. ;; Load colors and theme things
  14. ;; (load-file "~/.emacs.d/emacs/colors.el")
  15. ;; (load-file "~/.emacs.d/themes/dark-emacs-theme.el")
  16. ;; (require 'dark-emacs-theme)
  17. ;; (package-initialize)
  18. ;; (load-theme 'zenburn t)
  19. ;; (add-to-list 'custom-theme-load-path "~/.emacs.d/themes/emacs-color-theme-solarized")
  20. ;; (load-theme 'solarized-dark t)
  21. ;; (add-to-list 'custom-theme-load-path "~/.emacs.d/themes/solarized-emacs")
  22. ;; (load-theme 'solarized-dark t)
  23. ;; (add-to-list 'custom-theme-load-path "~/.emacs.d/themes/emacs-tron-theme")
  24. ;(load-theme 'tron t)
  25. ;; last t is for NO-ENABLE
  26. (load-theme 'tron t)
  27. ;(load-theme 'tron-legacy t t)
  28. (defcustom default-gui-theme 'tron
  29. "default gui theme")
  30. (defcustom default-cli-theme 'tron-legacy
  31. "default cli theme")
  32. (defun toggle-cli-theme ()
  33. (interactive)
  34. (let ((is-gui (find default-gui-theme custom-enabled-themes)))
  35. (dolist (theme custom-enabled-themes)
  36. (disable-theme theme))
  37. (load-theme (if is-gui default-cli-theme default-gui-theme))))
  38. (global-set-key (kbd "M-p") 'toggle-cli-theme)
  39. (defun pick-color-theme (frame)
  40. (select-frame frame)
  41. (if (window-system frame)
  42. (progn
  43. (disable-theme default-cli-theme)
  44. (enable-theme default-gui-theme)
  45. )
  46. (progn
  47. (disable-theme default-gui-theme)
  48. (disable-theme default-cli-theme)
  49. )))
  50. (add-hook 'after-make-frame-functions 'pick-color-theme)
  51. ;; For when started with emacs or emacs -nw rather than emacs --daemon
  52. (if window-system
  53. (disable-theme default-cli-theme)
  54. (enable-theme default-gui-theme))
  55. (provide 'conf-theme)