Replace face-spec-set with set-face-attribute

This commit is contained in:
eriedaberrie 2025-02-10 17:01:10 +00:00
parent b69b5c564a
commit cc1bffb22f

68
init.el
View file

@ -52,7 +52,7 @@
;; Prevent weird colors in the ribbons on solaire buffers at the cost of ;; Prevent weird colors in the ribbons on solaire buffers at the cost of
;; everything looking the same (worth it IMO) ;; everything looking the same (worth it IMO)
(with-eval-after-load 'solaire-mode (with-eval-after-load 'solaire-mode
(face-spec-set 'mode-line `((t (:background ,(catppuccin-get-color 'crust))))) (set-face-attribute 'mode-line nil :background (catppuccin-color 'crust))
;; NOTE: Technically this line is unnnecessary because of the previous but ;; NOTE: Technically this line is unnnecessary because of the previous but
;; I'll keep it here in case it ever becomes relevant ;; I'll keep it here in case it ever becomes relevant
(dolist (face '(mode-line mode-line-active mode-line-inactive)) (dolist (face '(mode-line mode-line-active mode-line-inactive))
@ -108,12 +108,12 @@
(with-eval-after-load 'catppuccin-theme (with-eval-after-load 'catppuccin-theme
(add-hook 'god-mode-enabled-hook (add-hook 'god-mode-enabled-hook
(lambda () (lambda ()
(face-spec-set 'cursor `((t (:background ,(catppuccin-get-color 'rosewater))))) (set-face-attribute 'cursor nil :background (catppuccin-color 'rosewater))
(unless (display-graphic-p) (unless (display-graphic-p)
(send-string-to-terminal "\e[2 q")))) (send-string-to-terminal "\e[2 q"))))
(add-hook 'god-mode-disabled-hook (add-hook 'god-mode-disabled-hook
(lambda () (lambda ()
(face-spec-set 'cursor `((t (:background ,(catppuccin-get-color 'mauve))))) (set-face-attribute 'cursor nil :background (catppuccin-color 'mauve))
(unless (display-graphic-p) (unless (display-graphic-p)
;; Escape codes for hbar cursor in insert mode ;; Escape codes for hbar cursor in insert mode
(send-string-to-terminal "\e[4 q"))))) (send-string-to-terminal "\e[4 q")))))
@ -180,13 +180,12 @@
(aw-keys '(?a ?w ?d ?f ?g ?h ?k ?l)) (aw-keys '(?a ?w ?d ?f ?g ?h ?k ?l))
:config :config
(with-eval-after-load 'catppuccin-theme (with-eval-after-load 'catppuccin-theme
(face-spec-set 'aw-leading-char-face `((t (:foreground (set-face-attribute 'aw-leading-char-face nil
,(catppuccin-get-color 'crust) :foreground (catppuccin-color 'crust)
:background :background (catppuccin-color 'red)
,(catppuccin-get-color 'red) :weight 'bold)
:weight bold)))) (set-face-attribute 'aw-background-face nil
(face-spec-set 'aw-background-face `((t (:foreground :foreground (catppuccin-color 'overlay1))))
,(catppuccin-get-color 'overlay1)))))))
(use-package goggles (use-package goggles
:hook prog-mode :hook prog-mode
@ -194,11 +193,11 @@
:config :config
(setq-default goggles-pulse t) (setq-default goggles-pulse t)
(with-eval-after-load 'catppuccin-theme (with-eval-after-load 'catppuccin-theme
(let ((new-spec `((t (:background ,(catppuccin-get-color 'surface1)))))) (let ((goggles-bg (catppuccin-color 'surface1)))
(dolist (f '(goggles-added (dolist (f '(goggles-added
goggles-removed goggles-removed
goggles-changed)) goggles-changed))
(face-spec-set f new-spec))))) (set-face-attribute f nil :background goggles-bg)))))
(defun my--set-tab-width-2 () (defun my--set-tab-width-2 ()
(setq tab-width 2)) (setq tab-width 2))
@ -572,7 +571,7 @@
(advice-add #'org-latex-make-preamble (advice-add #'org-latex-make-preamble
:filter-args #'my--org-latex-make-preamble-change-class)) :filter-args #'my--org-latex-make-preamble-change-class))
(with-eval-after-load 'catppuccin-theme (with-eval-after-load 'catppuccin-theme
(face-spec-set 'org-block `((t (:foreground ,(catppuccin-get-color 'text))))))) (set-face-attribute 'org-block nil :foreground (catppuccin-color 'text))))
(use-package ob-asymptote (use-package ob-asymptote
:config :config
@ -616,28 +615,23 @@ This function is called by `org-babel-execute-src-block'."
(org-agenda-finalize . org-modern-agenda) (org-agenda-finalize . org-modern-agenda)
:config :config
(with-eval-after-load 'catppuccin-theme (with-eval-after-load 'catppuccin-theme
(face-spec-set 'org-modern-done `((t (:foreground (set-face-attribute 'org-modern-done nil
,(catppuccin-get-color 'text) :foreground (catppuccin-color 'text)
:background :background (catppuccin-color 'surface0))
,(catppuccin-get-color 'surface0))))) (set-face-attribute 'org-modern-date-inactive nil
(face-spec-set 'org-modern-date-inactive `((t (:foreground :foreground (catppuccin-color 'subtext0)
,(catppuccin-get-color 'subtext0) :background (catppuccin-color 'surface0))
:background (set-face-attribute 'org-modern-horizontal-rule nil
,(catppuccin-get-color 'surface0))))) :strike-through (catppuccin-color 'overlay1))
(face-spec-set 'org-modern-horizontal-rule `((t (:strike-through (set-face-attribute 'org-modern-tag nil
,(catppuccin-get-color 'overlay1))))) :foreground (catppuccin-color 'base)
(face-spec-set 'org-modern-tag `((t (:foreground :background (catppuccin-color 'sapphire))
,(catppuccin-get-color 'base) (set-face-attribute 'org-modern-time-active nil
:background :foreground (catppuccin-color 'base)
,(catppuccin-get-color 'sapphire))))) :background (catppuccin-color 'overlay2))
(face-spec-set 'org-modern-time-active `((t (:foreground (set-face-attribute 'org-modern-time-inactive nil
,(catppuccin-get-color 'base) :foreground (catppuccin-color 'base)
:background :background (catppuccin-color 'surface0))))
,(catppuccin-get-color 'overlay2)))))
(face-spec-set 'org-modern-time-inactive `((t (:foreground
,(catppuccin-get-color 'base)
:background
,(catppuccin-get-color 'surface0)))))))
(use-package org-modern-indent (use-package org-modern-indent
:ensure nil :ensure nil
@ -836,8 +830,8 @@ This function is called by `org-babel-execute-src-block'."
(defun my-load-theme-with-solaire () (defun my-load-theme-with-solaire ()
(load-theme 'catppuccin t) (load-theme 'catppuccin t)
(catppuccin-reload) (catppuccin-reload)
(face-spec-set 'font-lock-variable-name-face `((t (:foreground (set-face-attribute 'font-lock-variable-name-face nil
,(catppuccin-get-color 'flamingo))))) :foreground (catppuccin-color 'flamingo))
(solaire-global-mode) (solaire-global-mode)
(when (daemonp) (when (daemonp)
(remove-hook 'server-after-make-frame-hook #'my-load-theme-with-solaire))) (remove-hook 'server-after-make-frame-hook #'my-load-theme-with-solaire)))