diff --git a/bundle/bundle--gui.el b/bundle/bundle--gui.el index ab089b3a..23cd7d76 100644 --- a/bundle/bundle--gui.el +++ b/bundle/bundle--gui.el @@ -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