Center frame

This commit is contained in:
Marcus Kammer 2023-10-07 12:23:57 +02:00
parent 0ab5d97241
commit b347767022

View file

@ -5,6 +5,22 @@
(height . 55)
(vertical-scroll-bars)))
(setq frame-resize-pixelwise t)
(defun center-frame (&optional frame)
"Center FRAME on the screen."
(interactive)
(let ((frame (or frame (selected-frame))))
(let ((frame-width (frame-pixel-width frame))
(frame-height (frame-pixel-height frame))
(display-width (display-pixel-width))
(display-height (display-pixel-height)))
(set-frame-position frame
(/ (- display-width frame-width) 2)
(/ (- display-height frame-height) 2)))))
(add-hook 'after-make-frame-functions 'center-frame)
(use-package all-the-icons
:if (display-graphic-p)
:commands all-the-icons-install-fonts