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

Skip to content

Do not require all-the-icons for footer icon, use it only if it is available #141

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 2 commits into from
Jun 3, 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
34 changes: 17 additions & 17 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ To update the banner or banner title

To customize which widgets are displayed, you can use the following snippet
#+BEGIN_SRC elisp
(setq dashboard-items '((recents . 5)
(bookmarks . 5)
(projects . 5)
(agenda . 5)
(registers . 5)))
(setq dashboard-items '((recents . 5)
(bookmarks . 5)
(projects . 5)
(agenda . 5)
(registers . 5)))
#+END_SRC
This will add the recent files, bookmarks, projects, org-agenda and registers widgets to your dashboard each displaying 5 items.

Expand All @@ -92,39 +92,39 @@ To add your own custom widget is pretty easy, define your widget's callback func

To add icons to the widget headings and their items:
#+BEGIN_SRC elisp
(setq dashboard-set-heading-icons t)
(setq dashboard-set-file-icons t)
(setq dashboard-set-heading-icons t)
(setq dashboard-set-file-icons t)
#+END_SRC

To modify heading icons with another icon from all-the-icons octicons:
#+BEGIN_SRC elisp
(dashboard-modify-heading-icons '((recents . "file-text")
(bookmarks . "book")))
(dashboard-modify-heading-icons '((recents . "file-text")
(bookmarks . "book")))
#+END_SRC

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

Also, the message can be customized like this:
#+BEGIN_SRC elisp
(setq dashboard-init-info "This is an init message!")
(setq dashboard-init-info "This is an init message!")
#+END_SRC

A randomly selected footnote will be displayed. To disable it:
#+BEGIN_SRC elisp
(setq dashboard-set-footer nil)
(setq dashboard-set-footer nil)
#+END_SRC

To customize it and customize its icon;

#+BEGIN_SRC elisp
(setq dashboard-footer "Dashboard is pretty cool!")
(setq dashboard-footer-icon (all-the-icons-octicon "dashboard"
:height 1.1
:v-adjust -0.05
:face 'font-lock-keyword-face))
(setq dashboard-footer "Dashboard is pretty cool!")
(setq dashboard-footer-icon (all-the-icons-octicon "dashboard"
:height 1.1
:v-adjust -0.05
:face 'font-lock-keyword-face))
#+END_SRC

** Org mode’s agenda
Expand Down
12 changes: 8 additions & 4 deletions dashboard-widgets.el
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,14 @@ to the specified width, with aspect ratio preserved."
(nth (random (1- (1+ (length list)))) list))
"A footer with some short message.")

(defvar dashboard-footer-icon (all-the-icons-fileicon "emacs"
:height 1.1
:v-adjust -0.05
:face 'font-lock-keyword-face)
(defvar dashboard-footer-icon
(if (or (fboundp 'all-the-icons-fileicon)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest add the checking (display-graphic-p here, and remove in Line 440. Otherwise ">" will never be displayed.

(require 'all-the-icons nil 'noerror))
(all-the-icons-fileicon "emacs"
:height 1.1
:v-adjust -0.05
:face 'font-lock-keyword-face)
">")
"Footer's icon.")

(defvar dashboard-startup-banner 'official
Expand Down