From 4fd3829d47b4aeaed20e3b8e0e9be660776a2a28 Mon Sep 17 00:00:00 2001 From: mir Date: Tue, 23 Jan 2024 10:35:52 -0900 Subject: [PATCH] Fix text scale forever, hopefully --- init.el | 4 ---- lisp/mir-defuns.el | 22 ++++++++++++---------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/init.el b/init.el index 53e24cd..72ad6e1 100644 --- a/init.el +++ b/init.el @@ -96,8 +96,4 @@ (setq gc-cons-threshold (* 2 1000 1000)) ;; (add-function :before #'after-focus-change-function #'garbage-collect) -;; Smallen buffer if windows -(if (equal (window-system) 'w32) - (text-scale-decrease 2)) - ;;; init.el ends here diff --git a/lisp/mir-defuns.el b/lisp/mir-defuns.el index c175614..40a7212 100644 --- a/lisp/mir-defuns.el +++ b/lisp/mir-defuns.el @@ -69,16 +69,18 @@ console." (if (>= (string-to-number emacs-version) 29) (pixel-scroll-precision-mode t) (pixel-scroll-mode t)) - ;; Size of text. お前 わ 毛 しんでる. - (if (eq system-type 'gnu/linux) - (progn - (set-face-attribute 'fixed-pitch nil :height 130) - (set-face-attribute 'default nil :height 130) - (set-face-attribute 'variable-pitch nil :height 140)) - (progn - (set-face-attribute 'fixed-pitch nil :height 100) - (set-face-attribute 'default nil :height 100) - (set-face-attribute 'variable-pitch nil :height 110)))) + ;; Size of text. おまえ わ もう しんでいる. + (let* ((resolution (mapcar #'string-to-number + (split-string + (cadr (split-string + (shell-command-to-string + "neofetch resolution"))) "x"))) + (resx (car resolution)) + (resy (cadr resolution)) + (font-height (/ resy 8))) + (set-face-attribute 'fixed-pitch nil :height font-height) + (set-face-attribute 'default nil :height font-height) + (set-face-attribute 'variable-pitch nil :height (+ font-height 10)))) (defun toggle-ja-input () "Switch between english and japanese. Broken."