Select roam dashboard/inbox from title

This commit is contained in:
Emmet 2024-07-16 08:33:30 -05:00
parent b6f621c964
commit ba2f97ab31
2 changed files with 28 additions and 8 deletions

View file

@ -727,8 +727,8 @@ If the path from LINK does not exist, nil is returned."
(defun org-roam-open-dashboard ()
"Open ${org-roam-directory}/dashboard.org (I use this naming convention to create dashboards for each of my org roam maps)"
(interactive)
(if (file-exists-p (concat org-roam-directory "/dashboard.org"))
(org-open-file (concat org-roam-directory "/dashboard.org"))
(if (org-roam-node-from-title-or-alias "Overview")
(org-roam-node-open (org-roam-node-from-title-or-alias "Overview"))
(dired org-roam-directory))
)
@ -740,11 +740,19 @@ If the path from LINK does not exist, nil is returned."
(message "No inbox found, capture something with M-x org-roam-capture-inbox"))
)
(defun org-roam-open-inbox ()
"Open ${org-roam-directory}/dashboard.org (I use this naming convention to create dashboards for each of my org roam maps)"
(interactive)
(if (org-roam-node-from-title-or-alias "Inbox")
(org-roam-node-open (org-roam-node-from-title-or-alias "Inbox"))
(message "No inbox found, capture something with M-x org-roam-capture-inbox"))
)
(defun org-roam-capture-inbox ()
(interactive)
(org-roam-capture- :node (org-roam-node-create)
(org-roam-capture- :node (org-roam-node-from-title-or-alias "Inbox")
:templates '(("i" "inbox" plain "* %?"
:if-new (file+head "inbox.org" "#+title: Inbox\n")))))
:if-new (file+head "%<%Y%m%d%H%M%S>-inbox.org" "#+title: Inbox\n")))))
(defun org-roam-switch-db (&optional arg silent)
"Switch to a different org-roam database, arg"

View file

@ -866,8 +866,8 @@ exit
(defun org-roam-open-dashboard ()
"Open ${org-roam-directory}/dashboard.org (I use this naming convention to create dashboards for each of my org roam maps)"
(interactive)
(if (file-exists-p (concat org-roam-directory "/dashboard.org"))
(org-open-file (concat org-roam-directory "/dashboard.org"))
(if (org-roam-node-from-title-or-alias "Overview")
(org-roam-node-open (org-roam-node-from-title-or-alias "Overview"))
(dired org-roam-directory))
)
@ -879,11 +879,19 @@ exit
(message "No inbox found, capture something with M-x org-roam-capture-inbox"))
)
(defun org-roam-open-inbox ()
"Open ${org-roam-directory}/dashboard.org (I use this naming convention to create dashboards for each of my org roam maps)"
(interactive)
(if (org-roam-node-from-title-or-alias "Inbox")
(org-roam-node-open (org-roam-node-from-title-or-alias "Inbox"))
(message "No inbox found, capture something with M-x org-roam-capture-inbox"))
)
(defun org-roam-capture-inbox ()
(interactive)
(org-roam-capture- :node (org-roam-node-create)
(org-roam-capture- :node (org-roam-node-from-title-or-alias "Inbox")
:templates '(("i" "inbox" plain "* %?"
:if-new (file+head "inbox.org" "#+title: Inbox\n")))))
:if-new (file+head "%<%Y%m%d%H%M%S>-inbox.org" "#+title: Inbox\n")))))
(defun org-roam-switch-db (&optional arg silent)
"Switch to a different org-roam database, arg"
@ -932,6 +940,10 @@ exit
(org-roam-switch-db prev-org-roam-db-choice 1)))
#+END_SRC
#+RESULTS:
: org-roam-switch-db-id-open
*** Org Roam "todos" Tagging for Org Agenda
#+BEGIN_SRC emacs-lisp :tangle config.el
;;;------ Org-roam-agenda configuration ------;;;