Emacs: Don't reload the theme each time a frame is created.
Load the theme on init, fix the colors that need fixing when a frame is created, stop if the code ran in a GUI frame before.
This commit is contained in:
parent
8785bb905d
commit
8b94772e9a
|
@ -1,6 +1,6 @@
|
|||
;;; appearance.el --- Configure appearance. -*- lexical-binding: t; -*-
|
||||
|
||||
;; Time-stamp: <2020-11-30T20:02:17+0100>
|
||||
;; Time-stamp: <2020-12-05T08:55:31+0100>
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
|
@ -67,8 +67,10 @@
|
|||
:custom ((doom-themes-treemacs-theme "doom-colors")
|
||||
(doom-themes-treemacs-enable-variable-pitch nil))
|
||||
:config (progn
|
||||
(defun my/reload-theme ()
|
||||
(load-theme 'doom-outrun-electric t)
|
||||
(defvar my/run-fix-theme t)
|
||||
(defun my/fix-theme ()
|
||||
"Fix some colors, needed the for the first frame after server start."
|
||||
(when my/run-fix-theme
|
||||
(when (display-graphic-p)
|
||||
(set-face-background 'scroll-bar (face-background 'default))
|
||||
(set-face-foreground 'scroll-bar (face-foreground 'shadow)))
|
||||
|
@ -78,8 +80,11 @@
|
|||
(my/volatile-highlights-reset-color))
|
||||
(when (fboundp #'markdown-mode)
|
||||
(set-face-background 'markdown-code-face
|
||||
(face-background 'hl-line))))
|
||||
(my/reload-theme)
|
||||
(face-background 'hl-line)))
|
||||
(when (display-graphic-p)
|
||||
(setq my/run-fix-theme nil))))
|
||||
(load-theme 'doom-outrun-electric t)
|
||||
(my/fix-theme)
|
||||
|
||||
(doom-themes-visual-bell-config) ; Flash modeline on error.
|
||||
;; No icons in TUI, see
|
||||
|
@ -105,7 +110,7 @@
|
|||
(set-window-fringes (selected-window) 8))
|
||||
(advice-add #'doom-themes-hide-fringes-maybe
|
||||
:after #'my/treemacs-reset-fringe))
|
||||
:hook (server-after-make-frame . my/reload-theme))
|
||||
:hook (server-after-make-frame . my/fix-theme))
|
||||
|
||||
;; Neat modeline.
|
||||
(use-package doom-modeline
|
||||
|
|
Loading…
Reference in New Issue
Block a user