diff options
Diffstat (limited to 'inbox_for_todoist.widget')
-rwxr-xr-x | inbox_for_todoist.widget/index.coffee | 45 | ||||
-rw-r--r-- | inbox_for_todoist.widget/run.sh | 2 | ||||
-rw-r--r-- | inbox_for_todoist.widget/todoistinbox.py | 13 |
3 files changed, 60 insertions, 0 deletions
diff --git a/inbox_for_todoist.widget/index.coffee b/inbox_for_todoist.widget/index.coffee new file mode 100755 index 0000000..b571976 --- /dev/null +++ b/inbox_for_todoist.widget/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/inbox_for_todoist.widget/run.sh b/inbox_for_todoist.widget/run.sh new file mode 100644 index 0000000..16cb830 --- /dev/null +++ b/inbox_for_todoist.widget/run.sh @@ -0,0 +1,2 @@ +export LANG=en_CA.UTF-8; +python3 todoist/todoistinbox.py diff --git a/inbox_for_todoist.widget/todoistinbox.py b/inbox_for_todoist.widget/todoistinbox.py new file mode 100644 index 0000000..c350812 --- /dev/null +++ b/inbox_for_todoist.widget/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() |