Live data from Hacker News

Colout – add colors to a text stream in your terminal

nojhan.github.io

11–20 of 41 posts

Re: Colout – add colors to a text stream in your terminal

#14
post #13

This might be a dumb question: are there shells that have a HTML-based front and passes commands into the background? Seems like something like that would be far more flexible than this – which feels like a Jenga tower of hacks.

TermKit[1] was built in this way a few years ago. It was novel at the time and the demo[2] seemed promising, but looks like it hasn't been updated in ~2 years now.

[1] https://github.com/unconed/TermKit

[2] http://www.youtube.com/watch?v=_6Z5dnlfcls

Re: Colout – add colors to a text stream in your terminal

#15
post #6

The background image of this site causes a weird strobing effect on the screen of my MacBook Pro 6,2. Really odd. When I drag it over to the cinema display it looks fine. Noone else here in the office can see it, both those with good vision and those who are technically blind. Maybe I have special powers. Or a brain tumor. EDIT: The tool is great btw :)

Try this test page: http://www.lagom.nl/lcd-test/inversion.php

This is somewhere between "oh god my eyes" and extremely interesting. Thanks for sharing that!

Re: Colout – add colors to a text stream in your terminal

#16

Not entirely sure of the feature overlap, but this seems to reinvent grcat and its frontend, grc [1], a little bit. Grcat lets you configure commands with colour regexps. Then you just prefix the command with "grc", and it will colorize the output according the rules. It's useful to alias commands this way: $ alias make="grc make" colout seems most useful when you are want to highlight arbitrary patterns independent…

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.).

Re: Colout – add colors to a text stream in your terminal

#17
post #8

Just 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.

Re: Colout – add colors to a text stream in your terminal

#18
post #16

Not entirely sure of the feature overlap, but this seems to reinvent grcat and its frontend, grc [1], a little bit. Grcat lets you configure commands with colour regexps. Then you just prefix the command with "grc", and it will colorize the output according the rules. It's useful to alias commands this way: $ alias make="grc make" colout seems most useful when you are want to highlight arbitrary patterns independent…

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, otherwise you can't reliably use colout in an alias (as pointed out elsewhere in this thread).

Post reply on HN