From 1948073ac7e19e5874c4c3b09c5019e4b255dc10 Mon Sep 17 00:00:00 2001 From: Jakub Czajka Date: Thu, 22 Dec 2022 21:55:00 +0100 Subject: [PATCH] [emacs] Customize theme. Emacs themes consist of faces. Each face represents a specific element of the interface. This commit defines a set of faces, forming a theme. --- conf/home/emacs.scm | 1 + emacs/.config/emacs/conf/conf-theme.el | 36 ++++++++++++++++++++++++++ emacs/.config/emacs/init.el | 3 +++ 3 files changed, 40 insertions(+) create mode 100644 emacs/.config/emacs/conf/conf-theme.el diff --git a/conf/home/emacs.scm b/conf/home/emacs.scm index b188c07..441dfde 100644 --- a/conf/home/emacs.scm +++ b/conf/home/emacs.scm @@ -32,6 +32,7 @@ (list emacs)) (dotfiles (list "emacs/.config/emacs/init.el" + "emacs/.config/emacs/conf/conf-theme.el" "emacs/.local/bin/emacs_client"))))) (define emacs-services diff --git a/emacs/.config/emacs/conf/conf-theme.el b/emacs/.config/emacs/conf/conf-theme.el new file mode 100644 index 0000000..5fd72d5 --- /dev/null +++ b/emacs/.config/emacs/conf/conf-theme.el @@ -0,0 +1,36 @@ +;; Copyright (c) 2022 Jakub Czajka +;; License: GPL-3.0 or later. +;; +;; conf-theme.el - custom theme. + +(deftheme conf + "Custom theme.") + +(custom-theme-set-faces + 'conf + ;; Buffer rendering. + `(default ((t (:background "#2a2a2a" :foreground "#f5f5f5")))) + `(cursor ((t (:background "#808080")))) + `(fringe ((t (:inherit default)))) + `(highlight ((t (:inherit default :box "#ffffff")))) + `(italic ((t (:underline nil)))) + `(link ((t (:foreground "#63a8ce" :underline t)))) + ;; Symbols. + `(font-lock-comment-face ((t (:foreground "#00b000")))) + `(font-lock-constant-face ((t (:foreground "#fcb321")))) + `(font-lock-doc-face ((t (:inherit font-lock-comment-face)))) + `(font-lock-function-name-face ((t (:foreground "#fed065")))) + `(font-lock-keyword-face ((t (:foreground "#75bff3")))) + `(font-lock-string-face ((t (:foreground "#fcba04")))) + `(font-lock-type-face ((t (:foreground "#5398be")))) + `(font-lock-variable-name-face ((t (:foreground "#ce9878")))) + ;; Mode line. + `(mode-line ((t (:background "#423f3b" + :box "#7f7f7f" + :foreground "#d5d5d5")))) + `(mode-line-inactive ((t (:inherit mode-line)))) + ;; Selection. + `(region ((t (:background "#204461")))) + `(secondary-selection ((t (:inherit region))))) + +(provide-theme 'conf) diff --git a/emacs/.config/emacs/init.el b/emacs/.config/emacs/init.el index b6e8b23..64fe898 100644 --- a/emacs/.config/emacs/init.el +++ b/emacs/.config/emacs/init.el @@ -5,7 +5,10 @@ ;; directory. (let ((conf-directory (expand-file-name "conf" user-emacs-directory))) + (push conf-directory custom-theme-load-path) (push conf-directory load-path) + (load-theme 'conf t) + (dolist (file (directory-files conf-directory nil ".+\\.el?$")) (require (intern (file-name-sans-extension file))))) -- 2.39.5