Pjcolor is a small AWK script for coloring and formating "pijul change" command like output.
README.md

Pjcolor

Pjcolor is a small AWK script for coloring and formating pijul change command like outputs. At the same time providing sane theming capabilities(as far as AWK allows)

Screenshot

Everyone loves screenshots, so here is one.

Pjcolor on Alacritty terminal

Default theme should look good with most dark and bright color schemes.

Install

  • Run pijul clone https://nest.pijul.com/levi/pjcolor

  • Place pjcolor file anywhere in the file system, for example in ~/pijul/scripts

  • Give it execute permission chod +x ~/pijul/scripts/pjcolor

  • Update your $PATH variable

    • In case of bash export PATH=$PATH:~/pijul/scripts/

    • Or add export PATH=$PATH:~/pijul/scripts/ in your ~/.profile or '~/.bashrc' file

    • In case of fish set PATH $PATH ~/pijul/scripts

    • Or add set -x PATH ~/pijul/scripts in your ~/.config/fish/config.fish file

    • In case of csh/tcsh (freeBSD) set path = ($path ~/pijul/scripts)

    • Or add set path = ($path ~/pijul/scripts) in your ~/.profile or ~/.login file

Usage

Pjcolor is just simple script to pipe through:
pijul change | pjcolor
or:
pijul change <HASH> | pjcolor

Theming

For compatibility reasons the Unicode arrow character at the beginning of the line (see screenshot) has been disabled by default.
To enable it, uncomment variable "MARKER" and install one of the following patched fonts:

  • Powerline https://github.com/powerline/fonts
  • Nerd fonts https://github.com/ryanoasis/nerd-fonts
  • Hack https://github.com/source-foundry/Hack
  • FiraCode https://github.com/tonsky/FiraCode

In case you want to create your own Pjcolor theme. It is best to include it like this:

@include "<your-custom-pjcolor-theme>"

Don't forget to comment out existing default theme. Also export your $AWKPATH Environment Variable. This will allow AWK to pickup your theme without need to provide full path.

Troubleshooting

If you are running system other than GNU/Linux you might need to install GNU version of awk. For example under FreeBSD this package is called gawk and its different from FreeBSD version of awk. Keep in mind you would also have to change Shebang path to #!/usr/local/bin/gawk -f and this is the case for FreeBSD system.