Last active
July 4, 2024 05:55
-
-
Save rtrppl/13f958e3e3bea87d8a715611b797d773 to your computer and use it in GitHub Desktop.
lt/auto-add-org-agenda
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun lt/auto-add-org-agenda () | |
"Automatically adds or removes org-files to org-agenda-files, based on whether or not they contain org-keywords." | |
(interactive) | |
(with-temp-file org-agenda-files (insert (shell-command-to-string (concat "rg -e '\\*.(TODO|NEXT|WAITING|RECREATION|PROJECT).[^%]' -g \"*.org\" -l " org-directory))))) ;; Adjust this to fit your own org-keywords | |
(add-hook 'org-agenda-mode-hook 'lt/auto-add-org-agenda) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment