├── README.md ├── Roam Daily Notes.alfredworkflow └── daily_notes.py /README.md: -------------------------------------------------------------------------------- 1 | # roam-daily-notes 2 | Alfred workflow that generates a Roam daily notes template 3 | 4 | This workflow allows you to use a snippet trigger with [Alfred](https://www.alfredapp.com/) to generate daily notes. The top-level attributes should be replaced with habits you would like to track, and can use a an attr-table to build a quick habit tracker. 5 | 6 | It also provides a space for Morning Pages. This is a space to start your day with some intentionality. You should have a separate page of questions and writing prompts, and drag blockrefs of 2 or 3 questions or prompts to answer for the day. My Morning Pages page looks like this: 7 | - Questions 8 | - What am I excited about? 9 | - What am I worried about? 10 | - Is there anything I'm forgetting? 11 | - What would I like to write about? 12 | - What's bothering me? 13 | - What do I need to prioritize? 14 | - Prompts 15 | - I love it when 16 | - I hate it when 17 | - When I wake up 18 | - When I go to sleep 19 | - If I could change one thing, it would be 20 | - Next year I want to 21 | - I miss 22 | 23 | At the end, it provides a space for a retrospective/time sieve (as described by Roam forum user mattbrockwell [in this thread](https://forum.roamresearch.com/t/what-would-be-your-top-3-tips-for-beginners/255)) to review your notes from the past. You can open these pages in the sidebar and potentially gain new insights into who you were, what you found important, and perhaps even something you're working on in the current day. 24 | 25 | ## Installation 26 | To install, all you need to do is download the Roam Daily Notes.alfredworkflow file from this repo and 27 | open it with Alfred. Define the snippet trigger you want to use (I like `\\xrdn`) and use it whenever you 28 | want to generate your daily notes. The script that generates the template is also available to look 29 | at in this repo. 30 | 31 | ## Output 32 | [Video demo](https://www.loom.com/share/4d9543d505834dc1970324326871ab5a) 33 | 34 | An example output looks like this (with the query results filled in, of course): 35 | ``` 36 | - [[Daily Mantras]] 37 | - Meditate:: --- 38 | - Gym/Exercise:: 39 | - Read for pleasure:: 40 | - Read for learning:: 41 | - Greek:: 42 | - Bass:: 43 | - ## Retrospective 44 | - One week ago: [[September 25th, 2020]] 45 | - Four weeks ago: [[September 4th, 2020]] 46 | - Twelve weeks ago: [[July 10th, 2020]] 47 | - 365 days ago: [[October 3rd, 2019]] 48 | - ## [[Tasks]] 49 | - {{query: {and: [[TODO]] {not: [[Overdue Tasks]]}{between: [[today]] [[today]]}}}} 50 | - ## [[Overdue Tasks]] 51 | - {{query: {and: [[TODO]] {not: {or: [[query]][[Archive]]}}}{between: [[yesterday]] [[January 1st, 2020]]}}}} 52 | - ## [[Completed Tasks]] 53 | - {{query: {and: [[DONE]] {not: {or:[[Overdue Tasks]] [[Archive]]}}{between: [[today]] [[today]]}}}} 54 | - ## [[Tracking]] 55 | - [[Sleep Score]] 56 | - {{[[slider]]}} 57 | - [[Morning Energy]] 58 | - {{[[slider]]}} 59 | - [[Cups of Coffee]] 60 | - {{[[slider]]}} 61 | - [[Afternoon Energy]] 62 | - {{[[slider]]}} 63 | - ## [[Journal]] 64 | - [[Morning Pages]] 65 | ``` 66 | 67 | Use `#Archive` to mark TODOs as no longer relevant, or `#Future` to mark them as due in the future (along with the future date). 68 | 69 | Enjoyed this workflow? [Buy me a beer!](https://www.buymeacoffee.com/kylestratis) 70 | -------------------------------------------------------------------------------- /Roam Daily Notes.alfredworkflow: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kylestratis/roam-daily-notes/63a9b7cba1df23a7ca22e5337f67ad451e2044c9/Roam Daily Notes.alfredworkflow -------------------------------------------------------------------------------- /daily_notes.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import datetime 3 | 4 | 5 | def suffix(d): 6 | return "th" if 11 <= d <= 13 else {1: "st", 2: "nd", 3: "rd"}.get(d % 10, "th") 7 | 8 | 9 | def custom_strftime(fmt, t): 10 | return t.strftime(fmt).replace("{S}", str(t.day) + suffix(t.day)) 11 | 12 | 13 | def calculate_retro_dates(): 14 | today = datetime.date.today() 15 | retros = [ 16 | custom_strftime("%B {S}, %Y", today - datetime.timedelta(weeks=i)) 17 | for i in [1, 4, 12] 18 | ] 19 | retros.append(custom_strftime("%B {S}, %Y", today - datetime.timedelta(days=365))) 20 | retros.append( 21 | custom_strftime( 22 | "%B {S}, %Y", datetime.datetime.now().date().replace(month=1, day=1) 23 | ) 24 | ) 25 | return retros 26 | 27 | 28 | def generate_template(): 29 | retros = calculate_retro_dates() 30 | template = """ 31 | [[Daily Mantras]] 32 | Gym/Exercise:: --- 33 | Read for pleasure:: 34 | Read for learning:: 35 | Greek:: 36 | Bass:: 37 | Practice Elixir:: 38 | ## Retrospective 39 | One week ago: [[{one_week}]] 40 | Four weeks ago: [[{four_weeks}]] 41 | Twelve weeks ago: [[{twelve_weeks}]] 42 | 365 days ago: [[{one_year}]] 43 | ## [[Tasks]] 44 | {{{{query: {{and: [[TODO]] {{not: {{or:[[Overdue Tasks]] [[Archive]]}}}} {{between: [[today]] [[today]]}}}}}}}} 45 | ## [[Overdue Tasks]] 46 | {{{{query: {{and: [[TODO]] {{not: {{or: [[query]] [[Archive]] [[Future]]}}}} {{between: [[yesterday]] [[{beginning_of_year}]]}}}}}}}} 47 | ## [[Completed Tasks]] 48 | {{{{query: {{and: [[DONE]] {{not: {{or: [[query]] [[Overdue Tasks]] [[Archive]]}}}} {{between: [[today]] [[today]]}}}}}}}} 49 | ## [[Tracking]] 50 | [[Sleep Score]] 51 | {{{{[[slider]]}}}} 52 | [[Morning Energy]] 53 | {{{{[[slider]]}}}} 54 | [[Cups of Coffee]] 55 | {{{{[[slider]]}}}} 56 | [[Afternoon Energy]] 57 | {{{{[[slider]]}}}} 58 | ## [[Journal]] 59 | [[Morning Pages]] 60 | """.format( 61 | one_week=retros[0], 62 | four_weeks=retros[1], 63 | twelve_weeks=retros[2], 64 | one_year=retros[3], 65 | beginning_of_year=retros[4], 66 | ) 67 | return template 68 | 69 | 70 | s = generate_template() 71 | sys.stdout.write(s) 72 | --------------------------------------------------------------------------------