Colout – add colors to a text stream in your terminal
21–30 of 41 posts
Re: Colout – add colors to a text stream in your terminal
#22Earlier quoted context omitted.
Indeed. Having to build configuration file for each command was a pain in the ass. Colout is better integrated in my shell workflow and shows that config files are not mandatory (but colout themes do just the same). Plus, colout have a tons of additional features (256-colors mode, colormaps, etc.).
Really? grcat/grc's configs are very simple. For example, this is the config for colorizing diffs: regexp=^\+(.*$) colours=bold green count=more ======= regexp=^\-(--.+$|[^\-].*$|$) colours=bold red count=more ======== regexp=^\>([^\>].*|$) colours=bold green count=more ======= regexp=^\ I agree that colout works better for ad-hoc stuff. You should consider inverting the way it's invoked, though, to be more like grc,…
Re: Colout – add colors to a text stream in your terminal
#23Earlier quoted context omitted.
Really? grcat/grc's configs are very simple. For example, this is the config for colorizing diffs: regexp=^\+(.*$) colours=bold green count=more ======= regexp=^\-(--.+$|[^\-].*$|$) colours=bold red count=more ======== regexp=^\>([^\>].*|$) colours=bold green count=more ======= regexp=^\ I agree that colout works better for ad-hoc stuff. You should consider inverting the way it's invoked, though, to be more like grc,…
Having just seen both utilities, colout looks very useful while grc looks like a PITA. I don't want to write configs for every adhoc command.
Re: Colout – add colors to a text stream in your terminal
#24Earlier quoted context omitted.
Having just seen both utilities, colout looks very useful while grc looks like a PITA. I don't want to write configs for every adhoc command.
Yeah, grc is not for ad hoc utilities. It's meant to work with tools you use frequently, like make, diff, gcc, ping etc. where the syntax is known.
Re: Colout – add colors to a text stream in your terminal
#25Earlier quoted context omitted.
Indeed. Having to build configuration file for each command was a pain in the ass. Colout is better integrated in my shell workflow and shows that config files are not mandatory (but colout themes do just the same). Plus, colout have a tons of additional features (256-colors mode, colormaps, etc.).
Really? grcat/grc's configs are very simple. For example, this is the config for colorizing diffs: regexp=^\+(.*$) colours=bold green count=more ======= regexp=^\-(--.+$|[^\-].*$|$) colours=bold red count=more ======== regexp=^\>([^\>].*|$) colours=bold green count=more ======= regexp=^\ I agree that colout works better for ad-hoc stuff. You should consider inverting the way it's invoked, though, to be more like grc,…
Re: Colout – add colors to a text stream in your terminal
#26https://github.com/nojhan/colout/commit/37934e9266d05e1519ac...
https://github.com/nojhan/colout/commit/64454e42f1cf5a4f8cd4...
Update: 37934e9 still works with python 2.6
Re: Colout – add colors to a text stream in your terminal
#27Why did you have to switch to python3? https://github.com/nojhan/colout/commit/37934e9266d05e1519ac... https://github.com/nojhan/colout/commit/64454e42f1cf5a4f8cd4... Update: 37934e9 still works with python 2.6
Re: Colout – add colors to a text stream in your terminal
#28Re: Colout – add colors to a text stream in your terminal
#29Just installed it via pip and gave it a try. I like it! I think I can already find some interesting uses for it. A couple of suggestions: The website says: colout -r will give you the lists of available colors, colormaps, themes and supported programming languages. But I think that's a typo and should be 'colout -h'. Also, a handy alias list of common use cases would be great.
The `-h` switch show the help, but the `-r` show the resources loaded at startup. Alias for common use cases are named "themes" in the list of resources.
% colout -r
usage: colout.py [-h] [-g] [-c] [-l SCALE] [-a] [-t] [-s]
REGEX [COLOR] [STYLE]
colout.py: error: too few argumentsRe: Colout – add colors to a text stream in your terminal
#30I can see a bunch of ways I'll make use of this. The first one I attempted to work on involved trying to color scale the use% in the output of a "df -h".
Alas it didn't work as I expected it:
$ df -h | colout --scale 0,100 "([0-9]*)%" scale
ValueError: could not convert string to float:
However if I grep out just the /dev/sda line it does what I expected: $ df -h | grep /dev/sda | colout --scale 0,100 "([0-9]*)%" scale
/dev/sda 20G 3.2G 16G 17% /
The 17% is a pretty blue.Tips?