Giter Club home page Giter Club logo

ticktask's Introduction

Ticktask

Ticktask is a simple cli for ticktick to create tasks.

Features

  • Uses official open api (which is still under development, but creating tasks is already work)
  • Support date (*today and *tomorrow)
  • Support tags (starts with #)
  • Support task body (see config section)

Installation

Manual

Just save the ./ticktask file somewhere on your computer (for example, in /usr/local/bin/). Don't forget to set execute permission on file: chmod +x /path/to/ticktask

Setup

You need to obtain api key for ticktick, so go to https://developer.ticktick.com/manage and create your "app". P.S. you will be asked for ridirect_url setting. Set it to anything you want, for example http://127.0.0.1.

Next, you need to write your cliend_id and client_secret in config. Create ~/.config/ticktask/config.sh file with the following content:

CLIENT_ID="your_client_id"
CLIENT_SECRET="your_client_secret"

Then run ticktask and follow its instructions.

Congratulations! Your token saved in ~/.local/share/ticktask/token. Now you can jump to usage section.

Usage

Just run ticktask with your task title as argument. Example:

ticktask my new task created with ticktask

You can use date rules *today and *tomorrow which will be applied to task and removed from title text. The same for tags which starts with #.

Note: if for some reasons ticktask can't send request to ticktick, your task text will be saved in ~/.local/share/ticktask/error_tasks/ folder, so you will never lose anything. P.S. in such situation ticktask exit with code 2, so you can use it in your scripts (for example send notify with notify-send)

Use with hotkey

Personally, I use ticktask with dmenu. Command I use in hotkey:

echo -n | dmenu -p "ticktask:" | xargs -0 ticktask \
       && notify-send ticktask -t 1000 sent \
       || notify-send ticktask -u critical -t 2000 "not sent"

It opens dmenu prompt, then forwards result to tictask, and then sends notify with status "sent" or "not sent".

Config

Config file located at ~/.config/ticktask/config.sh. This is simply bash script, so it's very hackable and extensible.

For examples see ./config.example.sh

Task body (not necessary)

To be able to enter a task description, you can define function cmd_get_description() which should output the description as a result. For example, you can run any gui program with prompt, which will then print it to stdout.

Related projects

  • ticked - allows you to edit your ticktick.com tasks in your favorite editor (like vim/neovim).

ticktask's People

Contributors

unkwusr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ticktask's Issues

Auth error

Got this error :(

No access_token cached. Receiving new one
Opening browser
Paste url you've been redirected: Opening in existing browser session.
http://127.0.0.1/?code=d2G23X&state=state
Code: d2G23X
Bad response for getting access_token: <!doctype html><html lang="en"><head><title>HTTP Status 401 – Unauthorized</title><style type="text/css">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 401 – Unauthorized</h1><hr class="line" /><p><b>Type</b> Status Report</p><p><b>Message</b> Unauthorized</p><p><b>Description</b> The request has not been applied because it lacks valid authentication credentials for the target resource.</p><hr class="line" /><h3>Apache Tomcat/9.0.43</h3></body></html>

CLIENT_ID and CLIENT_SECRET are OK

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.