Skip to content
A tailored Alfred Workflow that performs tasks using notion-py within the context of a specific Notion Template.
Branch: master
Clone or download
Latest commit 9582299 Jun 18, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
data feat: initial implementation of alfred-notion May 15, 2019
src feat: add subtitle on tasks when getting them Jun 8, 2019
.flake8 feat: add basic flake8 configuration (only change lines and complexity) May 14, 2019
.gitignore feat: initial implementation of alfred-notion May 15, 2019
LICENSE Initial commit May 10, 2019
README.md
alfred-notion-demo.gif chore: update README with actual information, add images/gif Jun 8, 2019
icon.png feat: initial implementation of alfred-notion May 15, 2019
info.plist chore: better description/readme and version in alfred workflow Jun 8, 2019
notion-token.png chore: update README with actual information, add images/gif Jun 8, 2019
requirements.txt feat: add requirements.txt for installing python dependencies Jun 8, 2019
workflow.png chore: update README with actual information, add images/gif Jun 8, 2019

README.md

A tailored Alfred Workflow that performs tasks using notion-py within the context of a specific Notion Template as described in this blog post.

Setup

There is a bit of setup required to make this project work as intended.

  1. Have a Notion account
  2. Have Alfred 3+ with access to workflows (i.e., powerpack)
  3. Have Python 3 installed on the system
  4. Have Specific Notion Template as described in this blog post
  5. Your Notion Token
  6. URLs for Several Notion Object

Install alfred-notion

Get the workflow in Alfred

There are two options:

  1. Create a Blank Workflow and dump the contents of this repository into it.
  2. Download the Exported Workflow (from latest releases) and import it into Alfred.

In either case, you'll mostly end up with the workflow added to Alfred.

Python

There are certain Python dependencies that are required for the scripts to work correctly. You need to navigate to the workflow's directory so that you can execute pip3 install -r requirements.txt from your terminal. Alternatively, you can manually install what is defined in the ./requirements.txt.

Finding your Notion Token

The first thing you'll need to do is get your Notion Token (156 character value) from your browser's cookies. Depending on what browser you are using this process will vary slightly. The following diagram demonstrates how to find it using Chrome on MacOS.

Finding your Notion URLs

We need to identify the Notion URLs for the:

  • Tags Database
  • Wins Database
  • Tasks Database
  • Year Page

These are can be acquired by finding the correct resource in your Notion and using the Copy Link found in the context menu (i.e., right click or the left-clicking ...).

Configure Data Files

Given the information we've taken note of in the last 2 sections, we can now configure our data files.

  1. Find ./data/tags.sample.json, and rename to ./data/tags.json.
  2. Find ./data/config.sample.json, and rename to ./data/config.json.
  3. Fill the value out in ./data/config.json with the Notion Token and Notion URLs:
  {
    "NOTION_TOKEN": "your-notion-token",
    "TAGS_DATABASE_URL": "your-notion-tags-database-url",
    "TASKS_DATABASE_URL": "your-notion-tasks-database-url",
    "WINS_DATABASE_URL": "your-notion-wins-database-url",
    "YEAR_PAGE_URL": "your-notion-year-page-url"
  }

Features

Navigation

:week

This keyword will open Notion to the current week.

  • The week page needs to exist.
  • Notion will become the forefront application and will open the current week.
  • After Notion opens, you lose the history (i.e., ability to go back) of that Notion's session. History works afterwards.

:day

This keyword will open Notion to the current day.

  • The day page needs to exist under the current week.
  • Notion will become the forefront application and will open the current day.
  • After Notion opens, you lose the history (i.e., ability to go back) of that Notion's session. History works afterwards.

Tags

:tag

This keyword allows you to create a new tag in your tags database.

  • After the tag has been added, a secondary action will run :update), updating the locally cached data file holding our tags.
  • You will likely want to add an icon after the fact on the newly added tag.

:update

This keyword allows you to update your local tags data file with what your database has.

  • This is done so we have a local cache to speed things up.
  • After making a new tag, this is done this automatically.

Wins

:win

This keyword allows you to create a new win in your wins database.

  • You can optionally open the Notion page for this win if you cmd + enter when entering the title.
    • After Notion opens, you lose the history (i.e., ability to go back) of that Notion's session. History works afterwards.
  • After entering the win's title you will be able to add multiple tags.
    • You can finish adding tags by selecting the Done option.

Tasks

:task

This keyword allows you to create a new task in your tasks database.

  • You can optionally open the Notion page for this task if you cmd + enter when entering the title.
    • Notion will become the forefront application.
    • After Notion opens, you lose the history (i.e., ability to go back) of that Notion's session. History works afterwards.
  • After entering the task's title you will be able to add multiple tags.
    • You can finish adding tags by selecting the Done option.
  • After entering the task's tags you can select the status.

:search

This keyword allows you to search your current day's tasks, and be able to open it in Notion or change its status.

  • Uses the filters of your current day's Linked Database of tasks.
  • Searches the word boundaries of title/tags/status of a task.
  • When selecting a task it will open its Notion page.
    • Notion will become the forefront application.
    • After Notion opens, you lose the history (i.e., ability to go back) of that Notion's session. History works afterwards.
  • You can optionally select the task with cmd + enter to change its status.
    • If the status changes to Completed the Completed On attribute of the task will be updated to the current time.

Notes

:note

This keyword allows you to append a text block at the end of your current day's notes section.

You can’t perform that action at this time.