From eb9dc786e9bade86b9591b31d4bc2cf596f261b7 Mon Sep 17 00:00:00 2001 From: Christopher James Hayward Date: Tue, 9 Feb 2021 09:18:38 -0500 Subject: [PATCH] Cleanup dashboard definition --- README.org | 54 ++++++++++++++++---------------------------- modules/interface.el | 38 ++++++++++++------------------- 2 files changed, 34 insertions(+), 58 deletions(-) diff --git a/README.org b/README.org index 8f2bd4a..ca2343f 100644 --- a/README.org +++ b/README.org @@ -1343,7 +1343,12 @@ Toggle global ligature mode with =SPC t g=. #+ATTR_LATEX: :width 420px [[./docs/images/desktop.png]] -Present a dashboard when first launching Emacs. +Present a dashboard when first launching Emacs. Customize the buttons of the navigator: + ++ Brain @ http://localhost:8080 ++ Homepage @ https://chrishayward.xyz ++ Athabasca @ https://login.athabascau.ca/cas/login ++ Bookshelf @ https://online.vitalsource.com #+begin_src emacs-lisp (use-package dashboard @@ -1355,42 +1360,23 @@ Present a dashboard when first launching Emacs. (dashboard-startup-banner 'logo) (dashboard-projects-backend 'projectile) (dashboard-items '((projects . 5) - (recents . 5) - (agenda . 5 ))) + (recents . 5) + (agenda . 5))) + (dashboard-navigator-buttons `(((,(all-the-icons-fileicon "brain" :height 1.1 :v-adjust 0.0) + "Brain" "Knowledge base" + (lambda (&rest _) (browse-url "http://localhost:8080")))) + ((,(all-the-icons-material "public" :height 1.1 :v-adjust 0.0) + "Homepage" "Personal website" + (lambda (&rest _) (browse-url "https://chrishayward.xyz")))) + ((,(all-the-icons-faicon "university" :height 1.1 :v-adjust 0.0) + "Athabasca" "Univeristy login" + (lambda (&rest _) (browse-url "https://login.athabascau.ca/cas/login")))) + ((,(all-the-icons-faicon "book" :height 1.1 :v-adjust 0.0) + "Bookshelf" "Vitalsource bookshelf" + (lambda (&rest _) (browse-url "https://online.vitalsource.com")))))) :config (dashboard-setup-startup-hook)) #+end_src -Customize the buttons of the navigator: - -+ Brain @ http://localhost:8080 -+ Homepage @ https://chrishayward.xyz -+ Athabasca @ https://login.athabascau.ca/cas/login -+ Bookshelf @ https://online.vitalsource.com - -#+begin_src emacs-lisp -(setq dashboard-navigator-buttons - `(;; First row. - ((,(all-the-icons-fileicon "brain" :height 1.1 :v-adjust 0.0) - "Brain" - "Knowledge base" - (lambda (&rest _) (browse-url "http://localhost:8080")))) - ;; Second row. - ((,(all-the-icons-material "public" :height 1.1 :v-adjust 0.0) - "Homepage" - "Personal website" - (lambda (&rest _) (browse-url "https://chrishayward.xyz")))) - ;; Third row. - ((,(all-the-icons-faicon "university" :height 1.1 :v-adjust 0.0) - "Athabasca" - "Univeristy login" - (lambda (&rest _) (browse-url "https://login.athabascau.ca/cas/login")))) - ;; Fourth row. - ((,(all-the-icons-faicon "book" :height 1.1 :v-adjust 0.0) - "Bookshelf" - "Vitalsource bookshelf" - (lambda (&rest _) (browse-url "https://online.vitalsource.com")))))) -#+end_src - When running in *daemon* mode, ensure that the dashboard is the initial buffer. #+begin_src emacs-lisp diff --git a/modules/interface.el b/modules/interface.el index 230083a..4be2e09 100644 --- a/modules/interface.el +++ b/modules/interface.el @@ -63,32 +63,22 @@ (dashboard-startup-banner 'logo) (dashboard-projects-backend 'projectile) (dashboard-items '((projects . 5) - (recents . 5) - (agenda . 5 ))) + (recents . 5) + (agenda . 5))) + (dashboard-navigator-buttons `(((,(all-the-icons-fileicon "brain" :height 1.1 :v-adjust 0.0) + "Brain" "Knowledge base" + (lambda (&rest _) (browse-url "http://localhost:8080")))) + ((,(all-the-icons-material "public" :height 1.1 :v-adjust 0.0) + "Homepage" "Personal website" + (lambda (&rest _) (browse-url "https://chrishayward.xyz")))) + ((,(all-the-icons-faicon "university" :height 1.1 :v-adjust 0.0) + "Athabasca" "Univeristy login" + (lambda (&rest _) (browse-url "https://login.athabascau.ca/cas/login")))) + ((,(all-the-icons-faicon "book" :height 1.1 :v-adjust 0.0) + "Bookshelf" "Vitalsource bookshelf" + (lambda (&rest _) (browse-url "https://online.vitalsource.com")))))) :config (dashboard-setup-startup-hook)) -(setq dashboard-navigator-buttons - `(;; First row. - ((,(all-the-icons-fileicon "brain" :height 1.1 :v-adjust 0.0) - "Brain" - "Knowledge base" - (lambda (&rest _) (browse-url "http://localhost:8080")))) - ;; Second row. - ((,(all-the-icons-material "public" :height 1.1 :v-adjust 0.0) - "Homepage" - "Personal website" - (lambda (&rest _) (browse-url "https://chrishayward.xyz")))) - ;; Third row. - ((,(all-the-icons-faicon "university" :height 1.1 :v-adjust 0.0) - "Athabasca" - "Univeristy login" - (lambda (&rest _) (browse-url "https://login.athabascau.ca/cas/login")))) - ;; Fourth row. - ((,(all-the-icons-faicon "book" :height 1.1 :v-adjust 0.0) - "Bookshelf" - "Vitalsource bookshelf" - (lambda (&rest _) (browse-url "https://online.vitalsource.com")))))) - (setq initial-buffer-choice (lambda () (get-buffer "*dashboard*")))