summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Chausse <ChausseBenjamin@users.noreply.github.com>2018-10-03 22:14:18 -0400
committerBenjamin Chausse <ChausseBenjamin@users.noreply.github.com>2018-10-03 22:14:18 -0400
commit71b6baf069c3e2b55db92908f01eaf4e6d77b577 (patch)
tree0b3969bf7486d02fc753db5caa4a0eec237296ae
parent5a1a905c8d13b815e5194a31e93dd79cfb415ea9 (diff)
Added Priority Color coding
-rw-r--r--.DS_Storebin6148 -> 6148 bytes
-rw-r--r--README.md11
-rwxr-xr-xinbox_for_todoist.widget/index.coffee8
-rw-r--r--inbox_for_todoist.widget/todoistinbox.py8
4 files changed, 25 insertions, 2 deletions
diff --git a/.DS_Store b/.DS_Store
index 8e8068c..0e87ef0 100644
--- a/.DS_Store
+++ b/.DS_Store
Binary files differ
diff --git a/README.md b/README.md
index f2a04ee..8977f87 100644
--- a/README.md
+++ b/README.md
@@ -28,8 +28,15 @@ By default, Inbox for Todoist refreshes every second. To reduce CPU & Memory Usa
- Removing the fourth `#` will make the widget refresh every `20 minutes`.
- Removing the fifth `#` will make the widget refresh every `hour`.
- Removing the sixth `#` will make the widget refresh every `12 hours`.
-
+## Priority Color Coding ##
+You can change the colors of tasks inside of the `.coffee` file.
+By default, tasks are colored the same way they are in the todoist mac app in dark.
+The following line to edit are:
+- To edit the color of tasks labelled `priority1`, edit the `rgba(r, g, b, a)` on line `21`
+- To edit the color of tasks labelled `priority2`, edit the `rgba(r, g, b, a)` on line `23`
+- To edit the color of tasks labelled `priority3`, edit the `rgba(r, g, b, a)` on line `25`
+- To edit the color of tasks labelled `priority4`, edit the `rgba(r, g, b, a)` on line `27`
+The default color for the widget is `rgba(#F2F2F2, 1.0)`.
## Possible Eventual Improvements ##
-- Priority Color coding
- Due Date Sorting
- Todoist Markdown Support
diff --git a/inbox_for_todoist.widget/index.coffee b/inbox_for_todoist.widget/index.coffee
index b571976..af9bfe0 100755
--- a/inbox_for_todoist.widget/index.coffee
+++ b/inbox_for_todoist.widget/index.coffee
@@ -17,6 +17,14 @@ style: """
font-size: 16px
font-family: Avenir-Light
text-align: left
+ .priority1
+ color: rgba(215, 65, 64, 1.0)
+ .priority2
+ color: rgba(255, 152, 76, 1.0)
+ .priority3
+ color: rgba(255, 210, 105, 1.0)
+ .priority4
+ color: rgba(#F2F2F2, 1.0)
.title
color: #F2F2F2
font-size: 24px
diff --git a/inbox_for_todoist.widget/todoistinbox.py b/inbox_for_todoist.widget/todoistinbox.py
index c350812..15e7bb3 100644
--- a/inbox_for_todoist.widget/todoistinbox.py
+++ b/inbox_for_todoist.widget/todoistinbox.py
@@ -7,6 +7,14 @@ def main(token='___YOUR TODOIST TOKEN HERE:___'):
for i in api.state['items']: #going through all the items in todoist
if i['project_id'] == 170911352: # if an item is in the inbox
if i['checked'] == 0: # if the item is incomplete
+ if i['priority'] == 1:
+ pri = "<p class='priority4'>"
+ elif i['priority'] == 2:
+ pri = "<p class='priority3'>"
+ elif i['priority'] == 3:
+ pri = "<p class='priority2'>"
+ elif i['priority'] == 4:
+ pri = "<p class='priority1'>"
rank += 1
print("<b>", rank, '- </b>', i['content'], "<p class='mini'> </p>") # print name and id
if __name__ == '__main__':