summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Chausse <ChausseBenjamin@users.noreply.github.com>2018-10-03 00:10:47 -0400
committerBenjamin Chausse <ChausseBenjamin@users.noreply.github.com>2018-10-03 00:10:47 -0400
commitba5a556e71b735b5458f2bedadf0fe95c5e1538b (patch)
tree363d7a5cd4e361c5cbf3157ea3a382e61786808a
parent4435c625bafbee703f4164901c1be02110acb3d2 (diff)
Initial Commit
-rw-r--r--README.md36
-rw-r--r--Screenshot.jpgbin0 -> 402988 bytes
-rwxr-xr-xindex.coffee45
-rw-r--r--run.sh2
-rw-r--r--todoistinbox.py13
5 files changed, 95 insertions, 1 deletions
diff --git a/README.md b/README.md
index ec7455d..487d9a1 100644
--- a/README.md
+++ b/README.md
@@ -1 +1,35 @@
-# Inbox for Todoist
+# Inbox for [Todoist](https://en.todoist.com/tour) #
+## An Übersicht widget for your Todoist Inbox ##
+---
+## About ##
+Inbox for [Todoist](https://en.todoist.com/tour) is a simple Übersicht widget designed to present your todoist inbox on your Desktop. It is in no way affiliated with the Brand Todoist or Doist in any way nor is it addiliated with [Übersicht](http://tracesof.net/uebersicht/) or [Felix Hageloh](https://github.com/felixhageloh)
+
+
+Below is a preview of what Inbox for Todoist can look like:
+![Screenshot](Screenshot.jpg)
+
+## Installation ##
+Clone this repository to your Übersicht folder:
+`~/Library/Application Support/Übersicht/widgets/``
+
+### Setting up your own Todoist Token ###
+On the second line of the `todoistinbox.py` file, replace
+`___YOUR TODOIST TOKEN HERE:___` (keep the ' ' for it to work) with your very own todoist API token.
+
+
+You todoist token can be found on [Todoist](https://todoist.com) inside of `settings` and then `Integrations`. It will be labelled as `API Token`.
+
+## Preferences ##
+### Refresh Rate ###
+By default, Inbox for Todoist refreshes every second. To reduce CPU & Memory Usage, you may go to line 5 of `index.coffee` and adjust this:
+- Removing the first `#` will make the widget refresh every `minute`.
+- Removing the second `#` will make the widget refresh every `5 minutes`.
+- Removing the third `#` will make the widget refresh every `10 minutes`.
+- 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`.
+
+## Possible Eventual Improvements ##
+- [ ] Priority Color coding
+- [ ] Due Date Sorting
+- Todoist Markdown Support
diff --git a/Screenshot.jpg b/Screenshot.jpg
new file mode 100644
index 0000000..65a0eaa
--- /dev/null
+++ b/Screenshot.jpg
Binary files differ
diff --git a/index.coffee b/index.coffee
new file mode 100755
index 0000000..b571976
--- /dev/null
+++ b/index.coffee
@@ -0,0 +1,45 @@
+# -*-coding:utf-8 -*
+
+command: ". todoist/run.sh"
+
+refreshFrequency: 1000#*60#*5#*2#*2#*3#*12
+
+style: """
+ top: 245px
+ right: 0px
+ width: 240px
+ height: 600px
+ margin-left: -(@width / 2)
+ overflow: hidden
+ .content
+ color: #F2F2F2
+ margin-left: 7px
+ font-size: 16px
+ font-family: Avenir-Light
+ text-align: left
+ .title
+ color: #F2F2F2
+ font-size: 24px
+ font-family: Avenir-Book
+ text-align: center
+ bg-blur = 10px
+ .bg-slice
+ position: absolute
+ top: -(bg-blur)
+ left: -(bg-blur)
+ width: 100% + 2*bg-blur
+ height: 100% + 2*bg-blur
+ -webkit-filter: blur(bg-blur)
+ .mini
+ font-size: 2px
+ line-height: 0%;
+"""
+
+render: (output) -> """
+ <canvas class='bg-slice'></canvas>
+ <div class='title'>Todoist Inbox</div>
+ <div class='content'>#{output}</div>
+"""
+
+afterRender: (domEl) ->
+ uebersicht.makeBgSlice(el) for el in $(domEl).find '.bg-slice'
diff --git a/run.sh b/run.sh
new file mode 100644
index 0000000..16cb830
--- /dev/null
+++ b/run.sh
@@ -0,0 +1,2 @@
+export LANG=en_CA.UTF-8;
+python3 todoist/todoistinbox.py
diff --git a/todoistinbox.py b/todoistinbox.py
new file mode 100644
index 0000000..c350812
--- /dev/null
+++ b/todoistinbox.py
@@ -0,0 +1,13 @@
+# -*-coding:utf-8 -*
+def main(token='___YOUR TODOIST TOKEN HERE:___'):
+ from todoist.api import TodoistAPI
+ api = TodoistAPI(token)
+ api.sync() # initial sync
+ rank = 0
+ 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
+ rank += 1
+ print("<b>", rank, '- </b>', i['content'], "<p class='mini'> </p>") # print name and id
+if __name__ == '__main__':
+ main()