From ec084f61c80e2a2707fdde887435356118e335e9 Mon Sep 17 00:00:00 2001 From: Sidharth Arya Date: Sun, 30 Jun 2019 00:29:55 +0530 Subject: [PATCH 1/3] Added: filtering by category for org mode --- dashboard-widgets.el | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/dashboard-widgets.el b/dashboard-widgets.el index 3ee2a118..6943141d 100644 --- a/dashboard-widgets.el +++ b/dashboard-widgets.el @@ -99,6 +99,13 @@ The format is: 'icon title help action face prefix suffix'. Example: '((\"☆\" \"Star\" \"Show stars\" (lambda (&rest _) (show-stars)) 'warning \"[\" \"]\"))") +(defvar dashboard-org-agenda-categories nil + "Specify the Categories to consider when using agenda in dashboard. +Example: +'(\"Tasks\" \"Habits\")") + + + (defvar dashboard-init-info ;; Check if package.el was loaded and if package loading was enabled (if (bound-and-true-p package-alist) @@ -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))) From c36cf313e4e7a3085133aad24b95ee975bcd44b5 Mon Sep 17 00:00:00 2001 From: Sidharth Arya Date: Mon, 1 Jul 2019 17:46:32 +0530 Subject: [PATCH 2/3] Added: filtering by category for org mode --- README.org | 6 ++++++ dashboard-widgets.el | 12 +++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) 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 6943141d..b2a7e2f0 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")) @@ -99,11 +106,6 @@ The format is: 'icon title help action face prefix suffix'. Example: '((\"☆\" \"Star\" \"Show stars\" (lambda (&rest _) (show-stars)) 'warning \"[\" \"]\"))") -(defvar dashboard-org-agenda-categories nil - "Specify the Categories to consider when using agenda in dashboard. -Example: -'(\"Tasks\" \"Habits\")") - (defvar dashboard-init-info From 678efbc20966eee1b6f8ab3cdb07133962d97f4c Mon Sep 17 00:00:00 2001 From: Sidharth Arya Date: Tue, 2 Jul 2019 15:27:50 +0530 Subject: [PATCH 3/3] Update dashboard-widgets.el --- dashboard-widgets.el | 2 -- 1 file changed, 2 deletions(-) diff --git a/dashboard-widgets.el b/dashboard-widgets.el index b2a7e2f0..dd0d6db8 100644 --- a/dashboard-widgets.el +++ b/dashboard-widgets.el @@ -106,8 +106,6 @@ The format is: 'icon title help action face prefix suffix'. Example: '((\"☆\" \"Star\" \"Show stars\" (lambda (&rest _) (show-stars)) 'warning \"[\" \"]\"))") - - (defvar dashboard-init-info ;; Check if package.el was loaded and if package loading was enabled (if (bound-and-true-p package-alist)