use lupan-themes if available

This commit is contained in:
Łukasz Pankowski 2020-01-06 20:44:29 +01:00
parent c219a76afa
commit da4836ce93

20
init.el
View File

@ -1170,8 +1170,19 @@ Argument FRAMES has the same meaning as for `set-frame-font'"
;;; ### Toggle between dark and light themes with a key ###
(setq my-dark-theme 'apropospriate-dark
my-light-theme 'apropospriate-light)
;;; Toggle between [my own dark and light
;;; themes](https://lupan.pl/lupan-themes/) if available in
;;; `~/.emacs.d/lupan-themes` otherwise falls back to another themes.
(let ((path (expand-file-name "~/.emacs.d/lupan-themes")))
(when (file-accessible-directory-p path)
(add-to-list 'load-path path t)))
(if (require 'lupan-themes nil t)
(setq my-dark-theme 'lupan-dark
my-light-theme 'lupan-light)
(setq my-dark-theme 'apropospriate-dark
my-light-theme 'apropospriate-light))
(defun my-toggle-theme ()
"Toggle between dark and light themes"
@ -1184,7 +1195,10 @@ Argument FRAMES has the same meaning as for `set-frame-font'"
(global-set-key (kbd "C-S-<f6>") #'my-toggle-theme)
(use-package apropospriate-theme
:config
:defer)
(if (or (require 'lupan-themes nil t)
(require 'apropospriate-theme nil t))
(my-toggle-theme))
(defun my-frame-setup-fn (&optional frame)