From 11c76256519cc9a089cc989aeb093c963c0371d8 Mon Sep 17 00:00:00 2001 From: minhtrannhat Date: Sun, 3 Oct 2021 13:48:02 -0400 Subject: [PATCH] added theme-changer --- doom-emacs/.doom.d/config.el | 37 +++++++++++++++++++++++++++++++++--- doom-emacs/.doom.d/custom.el | 2 ++ 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/doom-emacs/.doom.d/config.el b/doom-emacs/.doom.d/config.el index 23770f6..afaa8dd 100644 --- a/doom-emacs/.doom.d/config.el +++ b/doom-emacs/.doom.d/config.el @@ -24,6 +24,20 @@ (setq doom-theme 'doom-nord) +(defun synchronize-theme () + (let* ((light-theme 'doom-nord-light) + (dark-theme 'doom-nord) + (start-time-light-theme 6) + (end-time-light-theme 18) + (hour (string-to-number (substring (current-time-string) 11 13))) + (next-theme (if (member hour (number-sequence start-time-light-theme end-time-light-theme)) + light-theme dark-theme))) + (when (not (equal doom-theme next-theme)) + (setq doom-theme next-theme) + (load-theme next-theme)))) + +(run-with-timer 0 900 'synchronize-theme) + (with-eval-after-load 'doom-themes (doom-themes-treemacs-config)) (setq doom-themes-treemacs-theme "doom-colors") @@ -76,9 +90,6 @@ (add-hook! org-mode :append #'visual-line-mode) -;; tabs tabs -(setq centaur-tabs-cycle-scope 'tabs) - ;; fish fish (setq vterm-shell 'fish) @@ -100,3 +111,23 @@ (setq-default history-length 1000) (setq-default prescient-history-length 1000) + +;; Whether display the icon for `major-mode'. It respects `doom-modeline-icon'. +(setq doom-modeline-major-mode-icon t) + +;; Whether display the colorful icon for `major-mode'. +;; It respects `all-the-icons-color-icons'. +(setq doom-modeline-major-mode-color-icon t) + +;; Whether display the icon for the buffer state. It respects `doom-modeline-icon'. +(setq doom-modeline-buffer-state-icon t) + +;; Whether display the modification icon for the buffer. +;; It respects `doom-modeline-icon' and `doom-modeline-buffer-state-icon'. +(setq doom-modeline-buffer-modification-icon t) + +;; Whether to use unicode as a fallback (instead of ASCII) when not using icons. +(setq doom-modeline-unicode-fallback nil) + +;; Whether display the minor modes in the mode-line. +(setq doom-modeline-minor-modes nil) diff --git a/doom-emacs/.doom.d/custom.el b/doom-emacs/.doom.d/custom.el index be5f8ed..7eebb93 100644 --- a/doom-emacs/.doom.d/custom.el +++ b/doom-emacs/.doom.d/custom.el @@ -4,6 +4,8 @@ ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. + '(custom-safe-themes + '("1704976a1797342a1b4ea7a75bdbb3be1569f4619134341bd5a4c1cfb16abad4" "d268b67e0935b9ebc427cad88ded41e875abfcc27abd409726a92e55459e0d01" default)) '(git-gutter:update-interval 1) '(warning-suppress-log-types '((iedit) (iedit) (iedit) (iedit) (iedit) (iedit) (iedit))) '(warning-suppress-types