CCE

Emacs Dashboard

emacs-lisp:noweb yes:tangle ~/nix/lisp/dashboard.el
(provide 'cce/dashboard)
(use-package dashboard
  :after org
  :demand
  :init
  (dashboard-setup-startup-hook)
  (setq initial-buffer-choice (lambda () (get-buffer "*dashboard*"))
        dashboard-banner-logo-title "Welcome Home to the Arcology"
        dashboard-startup-banner "~/org/data/arcology.png"
        dashboard-center-content t
        show-week-agenda-p t)
  (setq dashboard-items '((recents  . 5)
                          (projects . 5)))
  (setq dashboard-footer-messages
        `(,(concat "don't blow the horn \\ "
                   "don't bang the drums \\ "
                   "don't be the head \\ "
                   "be the lion's rear")
          ,(concat "i can feel the rain \\ "
                   "long across open water \\ "
                   "you've traveled to me \\ "
                   "you meet the sun and take her \\ "
                   "she will return to me soon \\ ")
          "Do you see the sun? Do you see the signs Spring is coming?"))
  <<org-roam-dashboard>>
  )

Show Recent Org-Roam files in the dashboard

emacs-lisp#+name: org-roam-dashboard:noweb-ref org-roam-dashboard
(add-to-list 'dashboard-item-generators '(org-roam . dashboard-insert-org-roam))
(add-to-list 'dashboard-items '(org-roam . 10))
(defun dashboard-insert-org-roam (list-size)
  "Add the list of LIST-SIZE items of org-roam."
  (require 'org-roam)
  (dashboard-insert-section
   "Recent Roam Files:"
   (dashboard-subseq
    (mapcar (lambda (el)
              (first el))
            (org-roam-db-query [:select [title ]
                                :from files
                                :order :by mtime :desc
                                :limit $s1]
                               list-size))
    list-size)
   list-size
   'org-roam
   (dashboard-get-shortcut 'org-roam)
   `(lambda (&rest _) (org-roam-node-find nil ,el))
   el))