Random selection of startup banner
This commit is contained in:
parent
2554d16c16
commit
714d8b9bf5
|
@ -0,0 +1,7 @@
|
|||
Welcome to
|
||||
███████╗██████╗**█████╗**██████╗███████╗███╗***███╗*█████╗**██████╗███████╗ B
|
||||
██╔════╝██╔══██╗██╔══██╗██╔════╝██╔════╝████╗*████║██╔══██╗██╔════╝██╔════╝ E
|
||||
███████╗██████╔╝███████║██║*****█████╗**██╔████╔██║███████║██║*****███████╗ T
|
||||
╚════██║██╔═══╝*██╔══██║██║*****██╔══╝**██║╚██╔╝██║██╔══██║██║*****╚════██║ A
|
||||
███████║██║*****██║**██║╚██████╗███████╗██║*╚═╝*██║██║**██║╚██████╗███████║
|
||||
╚══════╝╚═╝*****╚═╝**╚═╝*╚═════╝╚══════╝╚═╝*****╚═╝╚═╝**╚═╝*╚═════╝╚══════╝
|
|
@ -0,0 +1,8 @@
|
|||
┏━━━┓
|
||||
┃┏━┓┃ Welcome to
|
||||
┃┗━━┓╋╋╋╋┏━━┓╋╋╋╋┏━━┓╋╋╋╋┏━━┓╋╋╋╋┏━━┓╋╋╋╋┏┓┏┓╋╋╋╋┏━━┓╋╋╋╋┏━━┓╋╋╋╋┏━━┓ b
|
||||
┗━━┓┃┏━━┓┃┏┓┃┏━━┓┃┏┓┃┏━━┓┃┏━┛┏━━┓┃┃━┫┏━━┓┃┗┛┃┏━━┓┃┏┓┃┏━━┓┃┏━┛┏━━┓┃━━┫ e
|
||||
┃┗━┛┃┗━━┛┃┗┛┃┗━━┛┃┏┓┃┗━━┛┃┗━┓┗━━┛┃┃━┫┗━━┛┃┃┃┃┗━━┛┃┏┓┃┗━━┛┃┗━┓┗━━┛┣━━┃ t
|
||||
┗━━━┛╋╋╋╋┃┏━┛╋╋╋╋┗┛┗┛╋╋╋╋┗━━┛╋╋╋╋┗━━┛╋╋╋╋┗┻┻┛╋╋╋╋┗┛┗┛╋╋╋╋┗━━┛╋╋╋╋┗━━┛ a
|
||||
╋╋╋╋╋╋╋╋╋┃┃[The best editor is neither Emacs nor Vim, it's Emacs+Vim]
|
||||
╋╋╋╋╋╋╋╋╋┗┛
|
|
@ -1,6 +1,10 @@
|
|||
(require 'dotspacemacs)
|
||||
(require 'ht)
|
||||
|
||||
(defconst configuration-layer-template-directory
|
||||
(expand-file-name (concat spacemacs-core-directory "templates/"))
|
||||
"Configuration layer templates directory.")
|
||||
|
||||
(defconst configuration-layer-contrib-directory
|
||||
(expand-file-name (concat user-emacs-directory "contrib/"))
|
||||
"Spacemacs contribution layers base directory.")
|
||||
|
@ -91,7 +95,7 @@ NAME."
|
|||
|
||||
(defun configuration-layer//copy-template (template)
|
||||
"Copy and replace special values of TEMPLATE to LAYER_DIR."
|
||||
(let ((src (concat spacemacs-template-directory
|
||||
(let ((src (concat configuration-layer-template-directory
|
||||
(format "%s.template" template)))
|
||||
(dest (concat (configuration-layer//get-private-layer-dir name)
|
||||
(format "%s.el" template))))
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
(defconst dotspacemacs-template-directory
|
||||
(expand-file-name (concat spacemacs-core-directory "templates/"))
|
||||
"Templates directory.")
|
||||
|
||||
(defvar dotspacemacs-configuration-layer-path '()
|
||||
"List of additional paths where to look for configuration layers.
|
||||
Paths must have a trailing slash (ie. `~/.mycontribs/')"
|
||||
)
|
||||
)
|
||||
|
||||
(defvar dotspacemacs-configuration-layers '()
|
||||
"list of contribution to load."
|
||||
|
@ -73,7 +77,7 @@ before installing the file if the destination already exists."
|
|||
dotfile))
|
||||
t)))
|
||||
(when install
|
||||
(copy-file (concat spacemacs-template-directory
|
||||
(copy-file (concat dotspacemacs-template-directory
|
||||
".spacemacs.template") dotfile t)
|
||||
(message "%s has been installed." dotfile))))
|
||||
|
||||
|
|
|
@ -9,9 +9,9 @@
|
|||
"Spacemacs core directory.")
|
||||
(add-to-list 'load-path spacemacs-core-directory)
|
||||
|
||||
(defconst spacemacs-template-directory
|
||||
(expand-file-name (concat spacemacs-core-directory "templates/"))
|
||||
"Spacemacs templates directory.")
|
||||
(defconst spacemacs-banner-directory
|
||||
(expand-file-name (concat spacemacs-core-directory "banners/"))
|
||||
"Spacemacs banners directory.")
|
||||
|
||||
;; additional paths
|
||||
(defconst user-home-directory
|
||||
|
@ -95,9 +95,7 @@
|
|||
(`w32 (spacemacs/set-font font 9))
|
||||
(other (spacemacs/set-font font 10)))))
|
||||
;; banner
|
||||
(let ((buffer-read-only nil))
|
||||
(insert-file-contents (concat spacemacs-core-directory "banner.txt"))
|
||||
(spacemacs/insert-buttons))
|
||||
(spacemacs//insert-banner)
|
||||
;; bind-key is required by use-package
|
||||
(spacemacs/load-or-install-package 'bind-key t)
|
||||
(spacemacs/load-or-install-package 'use-package t)
|
||||
|
@ -161,6 +159,18 @@ If LOG is non-nil a message is displayed in spacemacs-mode buffer."
|
|||
(add-to-list 'default-frame-alist (cons 'font fontstr))
|
||||
(set-default-font fontstr)))
|
||||
|
||||
(defun spacemacs//insert-banner ()
|
||||
"Choose a banner and insert in spacemacs buffer."
|
||||
(let* ((files (directory-files spacemacs-banner-directory nil nil 'nosort))
|
||||
(count (length files))
|
||||
;; -2 to remove `.' `..'
|
||||
(choice (random (- count 2)))
|
||||
(banner (format "%03d-banner.txt" choice))
|
||||
(buffer-read-only nil))
|
||||
(message "%s" count)
|
||||
(insert-file-contents (concat spacemacs-banner-directory banner))
|
||||
(spacemacs/insert-buttons)))
|
||||
|
||||
(defun spacemacs/message (msg &rest args)
|
||||
"Display MSG in message prepended with '(Spacemacs)'."
|
||||
(message "(Spacemacs) %s" (apply 'format msg args)))
|
||||
|
|
Loading…
Reference in New Issue