From 1957e46551dfd1acfcd53fec17fd9630304a11db Mon Sep 17 00:00:00 2001 From: Guangxiong Lin Date: Sun, 13 Mar 2022 01:50:20 +0800 Subject: Set appearance config for linux and mac (emacs) --- .emacs.d/init.el | 1 + .emacs.d/lisp/init-appearance.el | 23 +++++++++++++++++++++++ .emacs.d/lisp/init-misc.el | 7 ------- 3 files changed, 24 insertions(+), 7 deletions(-) create mode 100644 .emacs.d/lisp/init-appearance.el diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 496e37a..559b598 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -26,6 +26,7 @@ (require 'init-markdown) (require 'init-git) (require 'init-misc) +(require 'init-appearance) (setq custom-file (expand-file-name "custom.el" user-emacs-directory)) (unless (file-exists-p custom-file) diff --git a/.emacs.d/lisp/init-appearance.el b/.emacs.d/lisp/init-appearance.el new file mode 100644 index 0000000..50b14e7 --- /dev/null +++ b/.emacs.d/lisp/init-appearance.el @@ -0,0 +1,23 @@ +(defun gx/set-appearance--linux () + (set-face-attribute 'default nil :height 130)) + +(defun gx/set-appearance--mac () + (set-face-attribute 'default nil :height 160) + (custom-set-variables + '(initial-frame-alist '((fullscreen . maximized))))) + +(defun gx/set-appearance () + (when (display-graphic-p) + (when *is-a-linux* + (gx/set-appearance--linux)) + (when *is-a-mac* + (gx/set-appearance--mac)))) + +(add-hook 'after-init-hook + (lambda () + (gx/set-appearance))) + +(when (gx/maybe-require-package 'atom-one-dark-theme) + (load-theme 'atom-one-dark t)) + +(provide 'init-appearance) diff --git a/.emacs.d/lisp/init-misc.el b/.emacs.d/lisp/init-misc.el index 184626c..74037ca 100644 --- a/.emacs.d/lisp/init-misc.el +++ b/.emacs.d/lisp/init-misc.el @@ -47,13 +47,6 @@ (gx/maybe-require-package 'rg) (gx/maybe-require-package 'esup) -;; appearance -(gx/maybe-require-package 'atom-one-dark-theme) -(add-hook 'after-init-hook - (lambda () - (load-theme 'atom-one-dark t) - (set-face-attribute 'default nil :height 130))) - (when (gx/maybe-require-package 'which-key) (add-hook 'after-init-hook 'which-key-mode)) -- cgit v1.2.3