diff --git a/README.org b/README.org index cb9de420..733fef54 100644 --- a/README.org +++ b/README.org @@ -166,6 +166,12 @@ To show agenda for the upcoming seven days set the variable ~show-week-agenda-p~ Note that setting list-size for the agenda list is intentionally ignored; all agenda items for the current day will be displayed. +To customize which categories from the agenda items should be visible in the dashboard set the ~dashboard-org-agenda-categories~ to the list of categories you need. + +#+BEGIN_SRC elisp +(setq dashboard-org-agenda-categories '("Tasks" "Appointments")) + #+END_SRC + ** Faces It is possible to customize Dashboard's appearance using the following faces: diff --git a/dashboard-widgets.el b/dashboard-widgets.el index 3ee2a118..dd0d6db8 100644 --- a/dashboard-widgets.el +++ b/dashboard-widgets.el @@ -73,6 +73,13 @@ to the specified width, with aspect ratio preserved." :type 'boolean :group 'dashboard) +(defcustom dashboard-org-agenda-categories nil + "Specify the Categories to consider when using agenda in dashboard. +Example: +'(\"Tasks\" \"Habits\")" + :type 'list + :group 'dashboard) + (defconst dashboard-banners-directory (concat (file-name-directory (locate-library "dashboard")) @@ -606,12 +613,14 @@ date part is considered." t)) (loc (point)) (file (buffer-file-name))) - (when (and (not (org-entry-is-done-p)) - (or (and schedule-time (dashboard-date-due-p schedule-time due-date)) - (and deadline-time (dashboard-date-due-p deadline-time due-date)))) - (setq filtered-entries - (append filtered-entries - (list (list item schedule-time deadline-time loc file))))))) + (if (or (equal dashboard-org-agenda-categories nil) + (member (org-get-category) dashboard-org-agenda-categories)) + (when (and (not (org-entry-is-done-p)) + (or (and schedule-time (dashboard-date-due-p schedule-time due-date)) + (and deadline-time (dashboard-date-due-p deadline-time due-date)))) + (setq filtered-entries + (append filtered-entries + (list (list item schedule-time deadline-time loc file)))))))) nil 'agenda) filtered-entries)))