diff options
author | Benjamin Chausse <ChausseBenjamin@users.noreply.github.com> | 2018-10-03 00:10:47 -0400 |
---|---|---|
committer | Benjamin Chausse <ChausseBenjamin@users.noreply.github.com> | 2018-10-03 00:10:47 -0400 |
commit | ba5a556e71b735b5458f2bedadf0fe95c5e1538b (patch) | |
tree | 363d7a5cd4e361c5cbf3157ea3a382e61786808a | |
parent | 4435c625bafbee703f4164901c1be02110acb3d2 (diff) |
Initial Commit
-rw-r--r-- | README.md | 36 | ||||
-rw-r--r-- | Screenshot.jpg | bin | 0 -> 402988 bytes | |||
-rwxr-xr-x | index.coffee | 45 | ||||
-rw-r--r-- | run.sh | 2 | ||||
-rw-r--r-- | todoistinbox.py | 13 |
5 files changed, 95 insertions, 1 deletions
@@ -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 Binary files differnew file mode 100644 index 0000000..65a0eaa --- /dev/null +++ b/Screenshot.jpg 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' @@ -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() |