config theme

This commit is contained in:
zedhugh committed 2022-10-29 05:34:52 +08:00
1 parent b173fa0557
commit 84f0f1b3ae
5 files changed
+75

No files matched your search

+9
View File
@@ -124,3 +124,12 @@
[submodule "site-lisp/eslint-disable-rule"]
path = site-lisp/eslint-disable-rule
url = https://github.com/DamienCassou/eslint-disable-rule.git
[submodule "site-lisp/rainbow-identifiers"]
path = site-lisp/rainbow-identifiers
url = https://github.com/Fanael/rainbow-identifiers.git
[submodule "site-lisp/rainbow-delimiters"]
path = site-lisp/rainbow-delimiters
url = https://github.com/Fanael/rainbow-delimiters.git
[submodule "site-lisp/circadian"]
path = site-lisp/circadian
url = https://github.com/guidoschmidt/circadian.el.git
+63
View File
@@ -20,4 +20,67 @@
(add-to-list 'window-selection-change-functions #'creature/pulse-line)
;; address style
(add-hook 'erc-mode-hook #'goto-address-mode)
(add-hook 'text-mode-hook #'goto-address-mode)
(add-hook 'prog-mode-hook #'goto-address-prog-mode)
(autoload 'rainbow-delimiters-mode "rainbow-delimiters")
(autoload 'rainbow-identifiers-mode "rainbow-identifiers")
(dolist (mode '(rainbow-delimiters-mode rainbow-identifiers-mode))
(add-hook 'prog-mode-hook mode))
(require 'circadian)
(when (and (fboundp 'circadian-setup)
(custom-theme-name-valid-p 'modus-vivendi))
(setq circadian-themes '(("08:00" . modus-operandi)
("18:00" . modus-vivendi)))
(circadian-setup))
(defconst creature/font-config
;; '(("Operator Mono Book" . 16))
(if (eq system-type 'windows-nt)
(if (> (frame-pixel-width) 2560)
'(("等距更纱黑体 SC" . 24))
'(("等距更纱黑体 SC" . 16)))
'(("Sarasa Mono SC" . 16)))
;; '(("Source Code Pro" . 16))
"Font config.
It's a list of single-byte and multi-byte font.
Each font conf looks like (FAMILY . SIZE).")
(defun creature/fontset (&optional frame)
"Config fonts for FRAME.
if FRAME is nil, setup for current frame."
;; single-byte code
(setq inhibit-compacting-font-caches
(if (eq system-type 'window-nt) t nil))
(let ((single (car creature/font-config))
(multi (cdr creature/font-config)))
(let ((family (car single))
(size (cdr single)))
(when (or family size)
(condition-case nil
(set-face-attribute
'default frame
:font (font-spec :family family :size size))
(error nil))))
(let ((family (car multi))
(size (cdr multi)))
(when (member family (font-family-list))
(dolist (charset '(kana han cjk-misc bopomofo))
(condition-case nil
(set-fontset-font
t charset
(font-spec :family family :size size) frame)
(error nil)))))))
(add-hook 'emacs-startup-hook #'creature/fontset)
(add-hook 'server-after-make-frame-hook #'creature/fontset)
(provide 'init-theme)
Submodule site-lisp/circadian added at bf5a00ea45.