From ba5a556e71b735b5458f2bedadf0fe95c5e1538b Mon Sep 17 00:00:00 2001 From: Benjamin Chausse Date: Wed, 3 Oct 2018 00:10:47 -0400 Subject: Initial Commit --- README.md | 36 +++++++++++++++++++++++++++++++++++- Screenshot.jpg | Bin 0 -> 402988 bytes index.coffee | 45 +++++++++++++++++++++++++++++++++++++++++++++ run.sh | 2 ++ todoistinbox.py | 13 +++++++++++++ 5 files changed, 95 insertions(+), 1 deletion(-) create mode 100644 Screenshot.jpg create mode 100755 index.coffee create mode 100644 run.sh create mode 100644 todoistinbox.py 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 Binary files /dev/null and b/Screenshot.jpg 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) -> """ + +
Todoist Inbox
+
#{output}
+""" + +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("", rank, '- ', i['content'], "

") # print name and id +if __name__ == '__main__': + main() -- cgit v1.2.3