Skip to content
/ ansito Public

Transform ANSI codes to any other format (currently only Conky style)

License

Notifications You must be signed in to change notification settings

pawamoy/ansito

Repository files navigation

ansito

ci documentation pypi version gitpod gitter

Translate ANSI codes to any other format.

Currently, only Conky format is supported.

⚠️ This project is unmaintained. Drop me a message if you would like me to transfer it to you or add you as a collaborator.

Installation

With pip:

pip install ansito

With pipx:

python3.8 -m pip install --user pipx
pipx install ansito

Usage (command-line)

usage: ansito [-h] FILENAME

positional arguments:
  FILENAME    File to translate, or - for stdin.

optional arguments:
  -h, --help  show this help message and exit

Example:

command-that-output-colors | ansito -

Real-word example with taskwarrior in a Conky configuration file:

${texecpi 60 flock ~/.task task limit:10 rc.defaultwidth:80 rc._forcecolor:on rc.verbose:affected,blank list | ansito - | sed -r 's/([^ ])#/\1\\#/g'

⚠️ Conky does not have "background colors" for text, so ansito will not be able to convert the ANSI codes for background colors to Conky colors!