Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Added new init info functionality #126

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ To add icons to the widget headings and their items:
(setq dashboard-set-file-icons t)
#+END_SRC

To show info about the packages loaded and the init time:
#+BEGIN_SRC elisp
(setq dashboard-set-init-info t)
#+END_SRC

** Org mode’s agenda

To display today’s agenda items on the dashboard, add ~agenda~ to ~dashboard-items~:
Expand Down
15 changes: 14 additions & 1 deletion dashboard-widgets.el
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ to the specified width, with aspect ratio preserved."
:type 'boolean
:group 'dashboard)

(defcustom dashboard-set-init-info t
"When non nil, init info will be displayed under banner."
:type 'boolean
:group 'dashboard)

(defcustom dashboard-show-shortcuts t
"Whether to show shortcut keys for each section."
Expand All @@ -80,6 +84,10 @@ to the specified width, with aspect ratio preserved."
(defvar dashboard-banner-logo-title "Welcome to Emacs!"
"Specify the startup banner.")

(defvar dashboard-init-info (format "%d packages loaded in %s"
(length package-activated-list) (emacs-init-time))
"Init info with packages loaded and init time.")

(defvar dashboard-startup-banner 'official
"Specify the startup banner.
Default value is `official', it displays
Expand Down Expand Up @@ -230,7 +238,12 @@ If MESSAGEBUF is not nil then MSG is also written in message buffer."
(when title
(insert (make-string (max 0 (floor (/ (- dashboard-banner-length
(+ (length title) 1)) 2))) ?\ ))
(insert (format "%s\n\n" (propertize title 'face 'dashboard-banner-logo-title)))))))
(insert (format "%s\n\n" (propertize title 'face 'dashboard-banner-logo-title))))
(when dashboard-set-init-info
(insert (make-string (max 0 (floor (/ (- dashboard-banner-length
(+ (length dashboard-init-info) 1)) 2))) ?\ ))
(insert (concat
(propertize dashboard-init-info 'face 'font-lock-comment-face)))))))

(defun dashboard-get-banner-path (index)
"Return the full path to banner with index INDEX."
Expand Down