 ;; frames, however. There's always `doom//reload-theme' if you need it!
 (defun doom|init-theme-in-frame (frame)
   "Reloads the theme in new daemon or tty frames."
-  (when (or (daemonp) (not (display-graphic-p)))
+  (when (and (framep frame)
+             (not (eq doom-last-window-system (display-graphic-p frame))))
     (with-selected-frame frame
-      (doom|init-theme))))
-
-(add-hook! 'doom-init-ui-hook #'(doom|init-theme doom|init-fonts))
+      (doom|init-theme))
+    (setq doom-last-window-system (display-graphic-p frame))))
+
+;; fonts
+(add-hook 'doom-init-ui-hook #'doom|init-fonts)
+;; themes
+(add-hook 'after-make-frame-functions #'doom|init-theme-in-frame)
+(unless (daemonp)
+  (add-hook 'doom-init-ui-hook #'doom|init-theme))
 
 
 ;;

(defun doom|init-theme ()
  "Set the theme and load the font, in that order."
  (when doom-theme
    (load-theme doom-theme t))
  (add-hook 'after-make-frame-functions #'doom|init-theme-in-frame))

;; Getting themes to remain consistent across GUI Emacs, terminal Emacs and
;; daemon Emacs is hairy. `doom|init-theme' sorts out the initial GUI frame.

;; Theme & font
;;

(defvar doom-last-window-system window-system
  "The `window-system' of the last frame. If this doesn't match the current
frame's window-system, the theme will be reloaded.")

(defun doom|init-fonts ()
  "Initialize fonts."
  (condition-case-unless-debug ex
      (progn
        (when (fontp doom-font)
          (map-put default-frame-alist 'font (font-xlfd-name doom-font))
          (set-face-attribute 'fixed-pitch nil :font doom-font))
        ;; Fallback to `doom-unicode-font' for Unicode characters
        (when (fontp doom-unicode-font)
          (set-fontset-font t 'unicode doom-unicode-font nil))
        ;; ...and for variable-pitch-mode:
        (when (fontp doom-variable-pitch-font)
          (set-face-attribute 'variable-pitch nil :font doom-variable-pitch-font)))
    ('error
     (if (string-prefix-p "Font not available: " (error-message-string ex))
         (lwarn 'doom-ui :warning
