Implement splash screen
https://xenodium.com/emacs-a-welcoming-experiment/
This commit is contained in:
parent
21e43b4f4f
commit
3660fc6d0a
36
.emacs.d/early-init.el
Normal file
36
.emacs.d/early-init.el
Normal file
|
@ -0,0 +1,36 @@
|
|||
(setq package-enable-at-startup nil)
|
||||
|
||||
(defun ar/show-welcome-buffer ()
|
||||
"Show *Welcome* buffer."
|
||||
(with-current-buffer (get-buffer-create "*Welcome*")
|
||||
(setq truncate-lines t)
|
||||
(let* ((buffer-read-only)
|
||||
(image-path "~/.emacs.d/emacs.png")
|
||||
(image (create-image image-path))
|
||||
(size (image-size image))
|
||||
(height (cdr size))
|
||||
(width (car size))
|
||||
(top-margin (floor (/ (- (window-height) height) 2)))
|
||||
(left-margin (floor (/ (- (window-width) width) 2)))
|
||||
(title "Welcome to Emacs!"))
|
||||
(erase-buffer)
|
||||
(setq mode-line-format nil)
|
||||
(goto-char (point-min))
|
||||
(insert (make-string top-margin ?\n ))
|
||||
(insert (make-string left-margin ?\ ))
|
||||
(insert-image image)
|
||||
(insert "\n\n\n")
|
||||
(insert (make-string (floor (/ (- (window-width) (string-width title)) 2)) ?\ ))
|
||||
(insert title))
|
||||
(setq cursor-type nil)
|
||||
(read-only-mode +1)
|
||||
(switch-to-buffer (current-buffer))
|
||||
(local-set-key (kbd "q") 'kill-this-buffer)))
|
||||
|
||||
(setq initial-scratch-message nil)
|
||||
(setq inhibit-startup-screen t)
|
||||
|
||||
(when (< (length command-line-args) 2)
|
||||
(add-hook 'emacs-startup-hook (lambda ()
|
||||
(when (display-graphic-p)
|
||||
(ar/show-welcome-buffer)))))
|
BIN
.emacs.d/emacs.png
Normal file
BIN
.emacs.d/emacs.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 24 KiB |
Loading…
Reference in a new issue