only do the resolution stuff if neofetch exists

This commit is contained in:
Miranda Marquez 2024-05-25 20:52:33 -08:00
parent 7dcc262d39
commit 240ec1d4d3

View File

@ -71,17 +71,18 @@ console."
(pixel-scroll-precision-mode t) (pixel-scroll-precision-mode t)
(pixel-scroll-mode t)) (pixel-scroll-mode t))
;; Size of text. おまえ わ もう しんでいる. ;; Size of text. おまえ わ もう しんでいる.
(let* ((resolution (mapcar #'string-to-number (if (executable-find "neofetch")
(split-string (let* ((resolution (mapcar #'string-to-number
(cadr (split-string (split-string
(shell-command-to-string (cadr (split-string
"neofetch resolution"))) "x"))) (shell-command-to-string
(resx (car resolution)) "neofetch resolution"))) "x")))
(resy (cadr resolution)) (resx (car resolution))
(font-height (/ resy 11))) (resy (cadr resolution))
(set-face-attribute 'fixed-pitch nil :height font-height) (font-height (/ resy 11)))
(set-face-attribute 'default nil :height font-height) (set-face-attribute 'fixed-pitch nil :height font-height)
(set-face-attribute 'variable-pitch nil :height (+ font-height 10)))) (set-face-attribute 'default nil :height font-height)
(set-face-attribute 'variable-pitch nil :height (+ font-height 10)))))
(defun toggle-ja-input () (defun toggle-ja-input ()
"Switch between english and japanese. Not broken." "Switch between english and japanese. Not broken."