home

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 229e7aa2bc417f36755eb0860df255ebbb992aaa
parent e0f22974525fd67a8cf55450a2812cd74ba71d4d
Author: Vincent Demeester <vincent@sbr.pm>
Date:   Thu,  9 Apr 2020 12:24:57 +0200

config-appearance: migrate theme functions

Signed-off-by: Vincent Demeester <vincent@sbr.pm>

Diffstat:
Mtools/emacs/config/config-appearance.el | 23++++++++++++++++++++++-
Mtools/emacs/config/setup-style.el | 27++-------------------------
2 files changed, 24 insertions(+), 26 deletions(-)

diff --git a/tools/emacs/config/config-appearance.el b/tools/emacs/config/config-appearance.el @@ -72,7 +72,28 @@ ;; UseTheme (use-package shortbrain-light-theme :config - (load-theme 'shortbrain-light)) + (load-theme 'shortbrain-light) + + (defun set-light-theme () + "Set the light theme with some customization if needed." + (interactive) + (use-package shortbrain-light-theme + :config + (load-theme 'shortbrain-light t))) + + (defun set-dark-theme () + "Set the dark theme with some customization if needed." + (interactive) + (use-package shortbrain-theme + :config + (load-theme 'shortbrain t))) + + (defun theme-switcher () + (interactive) + (let ((current-hour (string-to-number (format-time-string "%H")))) + (if (and (> current-hour 6) (< current-hour 20)) + (set-light-theme) + (set-dark-theme))))) ;; -UseTheme ;; UseMoody diff --git a/tools/emacs/config/setup-style.el b/tools/emacs/config/setup-style.el @@ -37,30 +37,7 @@ (use-package visual-fill-column :commands visual-fill-column-mode) - - (defun set-light-theme () - "Set the light theme with some customization if needed." - (interactive) - (use-package shortbrain-light-theme - :config - (load-theme 'shortbrain-light t))) - - (defun set-dark-theme () - "Set the dark theme with some customization if needed." - (interactive) - (use-package shortbrain-theme - :config - (load-theme 'shortbrain t))) - - (defun theme-switcher () - (interactive) - (let ((current-hour (string-to-number (format-time-string "%H")))) - (if (and (> current-hour 6) (< current-hour 20)) - (set-light-theme) - (set-dark-theme)))) - - ;; Run at every 3600 seconds, after 0s delay - ;; (run-with-timer 0 3600 'theme-switcher) - )) + ) + ) (provide 'setup-style)