ADD toggle for light and dark mode
This commit is contained in:
parent
24c327dfd9
commit
520477884b
82
etc/conf.org
82
etc/conf.org
|
@ -455,10 +455,25 @@ This theme has good functionality for many different modes without being over-th
|
||||||
|
|
||||||
Since I run emacs in [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Emacs-Server.html][client/server]] mode, the loaded theme can change depending on if the client is a terminal or server (terminals have far fewer colors). This makes the theme reset when terminal is loaded before gui or vice versa.
|
Since I run emacs in [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Emacs-Server.html][client/server]] mode, the loaded theme can change depending on if the client is a terminal or server (terminals have far fewer colors). This makes the theme reset when terminal is loaded before gui or vice versa.
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(defvar nd/theme 'spacemacs-dark)
|
(defvar nd/theme nil)
|
||||||
|
(defvar nd/theme-dark nil)
|
||||||
(defvar nd/theme-window-loaded nil)
|
(defvar nd/theme-window-loaded nil)
|
||||||
(defvar nd/theme-terminal-loaded nil)
|
(defvar nd/theme-terminal-loaded nil)
|
||||||
|
|
||||||
|
(defun nd/read-use-dark-mode-p ()
|
||||||
|
"Return t if flag file permits us to use dark mode."
|
||||||
|
(let ((path "/tmp/emacs-use-dark-mode"))
|
||||||
|
(when (f-exists-p path)
|
||||||
|
(equal (s-trim (f-read-text path)) "1"))))
|
||||||
|
|
||||||
|
(setq nd/theme-dark (nd/read-use-dark-mode-p))
|
||||||
|
|
||||||
|
(defmacro nd/choose-theme (light-stuff dark-stuff)
|
||||||
|
"Do LIGHT-STUFF or DARK-STUFF depending on the selected theme."
|
||||||
|
`(if nd/theme-dark ,dark-stuff ,light-stuff))
|
||||||
|
|
||||||
|
(setq nd/theme (nd/choose-theme 'spacemacs-light 'spacemacs-dark))
|
||||||
|
|
||||||
(setq default-frame-alist '((font . "Dejavu Sans Mono-11")))
|
(setq default-frame-alist '((font . "Dejavu Sans Mono-11")))
|
||||||
|
|
||||||
;; required for emacsclient/daemon setup
|
;; required for emacsclient/daemon setup
|
||||||
|
@ -565,13 +580,19 @@ Some modes like to make popup windows (eg ediff). This prevents that.
|
||||||
*** ace-window
|
*** ace-window
|
||||||
This is an elegant window selector. It displays a number in the corner when activated, and windows may be chosen by pressing the corresponding number. Note that spacemacs fails to make the numbers look nice so the theme code is a workaround to make them smaller and prettier.
|
This is an elegant window selector. It displays a number in the corner when activated, and windows may be chosen by pressing the corresponding number. Note that spacemacs fails to make the numbers look nice so the theme code is a workaround to make them smaller and prettier.
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(defvar nd/ace-window-fg nil)
|
||||||
|
(defvar nd/ace-window-bg nil)
|
||||||
|
|
||||||
|
(setq nd/ace-window-fg (nd/choose-theme "#F6E0F9" "#292b2e"))
|
||||||
|
(setq nd/ace-window-bg (nd/choose-theme "#7A1686" "#292b2e"))
|
||||||
|
|
||||||
(use-package ace-window
|
(use-package ace-window
|
||||||
:straight t
|
:straight t
|
||||||
:config
|
:config
|
||||||
(setq aw-background t)
|
(setq aw-background t)
|
||||||
(custom-set-faces '(aw-leading-char-face
|
(custom-set-faces `(aw-leading-char-face
|
||||||
((t (:foreground "#292b2e"
|
((t (:foreground ,nd/ace-window-fg
|
||||||
:background "#bc6ec5"
|
:background ,nd/ace-window-bg
|
||||||
:height 1.0
|
:height 1.0
|
||||||
:box nil))))))
|
:box nil))))))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
@ -584,10 +605,13 @@ This is an elegant window selector. It displays a number in the corner when acti
|
||||||
(format "%-50s %s" b f)
|
(format "%-50s %s" b f)
|
||||||
b)))
|
b)))
|
||||||
|
|
||||||
|
(defvar nd/ivy-match-bg nil)
|
||||||
|
|
||||||
|
(setq nd/ivy-match-bg (nd/choose-theme "#D4C7F3" "#534573"))
|
||||||
|
|
||||||
(use-package ivy
|
(use-package ivy
|
||||||
:straight t
|
:straight t
|
||||||
:delight
|
:delight
|
||||||
:custom-face (ivy-current-match ((t (:inherit bold :extend t :background "#534573"))))
|
|
||||||
:config
|
:config
|
||||||
(setq ivy-use-virtual-buffers nil
|
(setq ivy-use-virtual-buffers nil
|
||||||
ivy-sort-max-size 30000
|
ivy-sort-max-size 30000
|
||||||
|
@ -609,7 +633,10 @@ This is an elegant window selector. It displays a number in the corner when acti
|
||||||
(ivy--alist-set 'ivy-format-functions-alist t #'ivy-format-function-line)
|
(ivy--alist-set 'ivy-format-functions-alist t #'ivy-format-function-line)
|
||||||
(ivy-configure 'ivy-switch-buffer
|
(ivy-configure 'ivy-switch-buffer
|
||||||
:display-transformer-fn #'nd/ivy-swith-buffer-transformer-fn)
|
:display-transformer-fn #'nd/ivy-swith-buffer-transformer-fn)
|
||||||
(ivy-mode))
|
(ivy-mode)
|
||||||
|
(set-face-attribute 'ivy-current-match nil :inherit 'bold :extend t :background nd/ivy-match-bg)
|
||||||
|
;;(ivy-current-match ((t (:inherit bold :extend t :background 'nd/ivy-match-bg))))
|
||||||
|
)
|
||||||
|
|
||||||
;; ensure counsel and swiper are loaded
|
;; ensure counsel and swiper are loaded
|
||||||
(use-package counsel
|
(use-package counsel
|
||||||
|
@ -2187,13 +2214,18 @@ In terms of logging, I like to record the time of each change upon leaving any s
|
||||||
**** colors
|
**** colors
|
||||||
Aesthetically, I like all my keywords to have bold colors.
|
Aesthetically, I like all my keywords to have bold colors.
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(setq org-todo-keyword-faces
|
(setq
|
||||||
`((,org-x-kw-todo :foreground "light coral" :weight bold)
|
org-todo-keyword-faces
|
||||||
(,org-x-kw-next :foreground "khaki" :weight bold)
|
(-let (((todo next done wait hold canc)
|
||||||
(,org-x-kw-done :foreground "light green" :weight bold)
|
(nd/choose-theme
|
||||||
(,org-x-kw-wait :foreground "orange" :weight bold)
|
'("indian red" "dark goldenrod" "forest green" "dark orange" "dark violet" "DodgerBlue1")
|
||||||
(,org-x-kw-hold :foreground "violet" :weight bold)
|
'("light coral" "khaki" "light green" "orange" "violet" "deep sky blue"))))
|
||||||
(,org-x-kw-canc :foreground "deep sky blue" :weight bold)))
|
`((,org-x-kw-todo :foreground ,todo :weight bold)
|
||||||
|
(,org-x-kw-next :foreground ,next :weight bold)
|
||||||
|
(,org-x-kw-done :foreground ,done :weight bold)
|
||||||
|
(,org-x-kw-wait :foreground ,wait :weight bold)
|
||||||
|
(,org-x-kw-hold :foreground ,hold :weight bold)
|
||||||
|
(,org-x-kw-canc :foreground ,canc :weight bold))))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
*** links and IDs
|
*** links and IDs
|
||||||
IDs and links are useful for meetings where I either reference tasks to discuss or reference action items to do in the future.
|
IDs and links are useful for meetings where I either reference tasks to discuss or reference action items to do in the future.
|
||||||
|
@ -2264,11 +2296,15 @@ Each group also has its own color, defined by its prefix symbol.
|
||||||
(->> (alist-get prefix grouped-tags)
|
(->> (alist-get prefix grouped-tags)
|
||||||
(--map (list it :foreground color)))))
|
(--map (list it :foreground color)))))
|
||||||
(setq org-tag-faces
|
(setq org-tag-faces
|
||||||
(append
|
(-let (((loc res misc cat)
|
||||||
(add-foreground org-x-tag-location-prefix "PaleGreen")
|
(nd/choose-theme
|
||||||
(add-foreground org-x-tag-resource-prefix "SkyBlue")
|
'("medium sea green" "steel blue" "dark goldenrod" "dark violet")
|
||||||
(add-foreground org-x-tag-misc-prefix "PaleGoldenrod")
|
'("PaleGreen" "SkyBlue" "PaleGoldenrod" "violet"))))
|
||||||
(add-foreground org-x-tag-category-prefix "violet")))))
|
(append
|
||||||
|
(add-foreground org-x-tag-location-prefix loc)
|
||||||
|
(add-foreground org-x-tag-resource-prefix res)
|
||||||
|
(add-foreground org-x-tag-misc-prefix misc)
|
||||||
|
(add-foreground org-x-tag-category-prefix cat))))))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
*** properties
|
*** properties
|
||||||
The built-in =effort= is used as the fourth and final homonymous GTD context (the other three being covered above using tags). It is further restricted with =Effort_All= to allow easier filtering in the agenda.
|
The built-in =effort= is used as the fourth and final homonymous GTD context (the other three being covered above using tags). It is further restricted with =Effort_All= to allow easier filtering in the agenda.
|
||||||
|
@ -2443,9 +2479,15 @@ The modeline is a nice place to indicate if something is clocked in or out. Unfo
|
||||||
|
|
||||||
Solution: flashy colors.
|
Solution: flashy colors.
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(defvar nd/spaceline-clock-fg nil)
|
||||||
|
(defvar nd/spaceline-clock-bg nil)
|
||||||
|
|
||||||
|
(setq nd/spaceline-clock-fg (nd/choose-theme "#3E3D31" "#3E3D31"))
|
||||||
|
(setq nd/spaceline-clock-bg (nd/choose-theme "#88F918" "#66cd00"))
|
||||||
|
|
||||||
(defface nd/spaceline-highlight-clocked-face
|
(defface nd/spaceline-highlight-clocked-face
|
||||||
`((t (:background "chartreuse3"
|
`((t (:background ,nd/spaceline-clock-bg
|
||||||
:foreground "#3E3D31"
|
:foreground ,nd/spaceline-clock-fg
|
||||||
:inherit 'mode-line)))
|
:inherit 'mode-line)))
|
||||||
"Default highlight face for spaceline.")
|
"Default highlight face for spaceline.")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue