diff options
author | Guangxiong Lin <[email protected]> | 2022-03-13 01:50:20 +0800 |
---|---|---|
committer | Guangxiong Lin <[email protected]> | 2022-03-13 01:50:20 +0800 |
commit | 1957e46551dfd1acfcd53fec17fd9630304a11db (patch) | |
tree | a7a747c82655f08f55c2d6433567c207a215b6e4 | |
parent | 12c44f9236cc5d44385f7036aacb95a193c56974 (diff) | |
download | dotfiles-1957e46551dfd1acfcd53fec17fd9630304a11db.tar.gz dotfiles-1957e46551dfd1acfcd53fec17fd9630304a11db.tar.bz2 dotfiles-1957e46551dfd1acfcd53fec17fd9630304a11db.zip |
Set appearance config for linux and mac (emacs)
-rw-r--r-- | .emacs.d/init.el | 1 | ||||
-rw-r--r-- | .emacs.d/lisp/init-appearance.el | 23 | ||||
-rw-r--r-- | .emacs.d/lisp/init-misc.el | 7 |
3 files changed, 24 insertions, 7 deletions
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)) |