;; I don't use any of these (menu-bar-mode -1) (tool-bar-mode -1) (scroll-bar-mode -1) ;; Do not resize when font size changes (setq frame-resize-pixelwise t) ;; By default, start maximized, undecorated (add-to-list 'default-frame-alist '(fullscreen . maximized)) (add-to-list 'default-frame-alist '(undecorated . t)) ;; Extend this list from to add more startup frames. (defvar rul-startup-frames '(("main" . nil) ("terminals" . multi-vterm)) "Startup frame specifications. Each entry has the form (NAME . SETUP). NAME is the frame name. SETUP is an optional function or interactive command called in that frame.") (defun rul-run-startup-frame-setup (setup) "Run startup frame SETUP." (cond ((null setup) nil) ((commandp setup) (call-interactively setup)) ((functionp setup) (funcall setup)) (t (message "Ignoring invalid startup frame setup: %S" setup)))) (defun rul-apply-startup-frame-name (frame name) "Set FRAME name and title to NAME." (with-selected-frame frame (set-frame-name name) (modify-frame-parameters frame `((title . ,name))))) (defun rul-create-startup-frames () "Create the configured startup frames." (when (display-graphic-p) (let ((initial-frame (selected-frame)) (specs rul-startup-frames)) (when specs (pcase-let ((`(,name . ,setup) (car specs))) (rul-apply-startup-frame-name initial-frame name) (with-selected-frame initial-frame (rul-run-startup-frame-setup setup))) (dolist (spec (cdr specs)) (pcase-let ((`(,name . ,setup) spec)) (let ((frame (make-frame `((name . ,name) (title . ,name))))) (rul-apply-startup-frame-name frame name) (with-selected-frame frame (rul-run-startup-frame-setup setup))))) (select-frame initial-frame))))) (add-hook 'emacs-startup-hook #'rul-create-startup-frames) ;; Initialise installed packages, otherwise, basic functions are not ;; available during the initialization stage. (setq package-enable-at-startup t) ;; Do not report warnings. It's too noisy. (setq native-comp-async-report-warnings-errors 'silent) ;; Keep things minimal (setq inhibit-startup-screen t) (setq inhibit-startup-echo-area-message user-login-name)