catgirl timestamp colors

catgirl timestamp colors

From: Hoël Bézier
Hi!

I’ve recently come across catgirl, which I like a lot.

I have one issue with it, though (I wouldn’t be writing to you otherwise): 
timestamps are displayed using a gray color, but gray is my background color, 
so I can’t see them at all.

I’m using the Solarized color scheme, you can see terminal color definitions 
here:
https://raw.githubusercontent.com/altercation/solarized/master/xresources/solarized

For now I have patched the source here, setting timestamps to blue, but this 
feels like a hack and I was wondering if this could be made a configurable 
setting (at startup and in the configuration file).

Another (easier) solution would be to just change timestamps color as I have 
done.

Thanks
Hoël

Re: catgirl timestamp colors

From: Sebastian LaVine
I would also appreciate the ability to configure timestamp color. I have
a grey background in my terminal too (dracula-ish theme), and the dark
grey timestamps, while visible, require some squinting to make out.

I brought this up on #ascii.town a few months ago, but I recall the
response being something along the lines of "fix your terminal color
scheme".

I'd be willing to write a patch to add this, if given the OK that it
would be able to get merged. If not, that's totally fine, I'd just like
to know before working on it.

Hoël, would you be willing to share your patch?

-- Sebastian

---
Sebastian LaVine | https://smlavine.com
4 replies

Re: catgirl timestamp colors

From: Sebastian LaVine
Another solution I have thought of and tried is putting ANSI escape
sequences into my config file, like so:

	timestamp = ^[[32m%l:%M%P^[[0m

With '^[' being an actual escape character. However, this doesn't work.
Instead, a '^[' -- not the escape character -- is printed in its place,
along with the rest of the ANSI sequence. I would appreciate it if
anyone could help me understand why this happens.

I think that if this worked, it would be the best solution. It doesn't
require another config option and command line option, but gives the
user as much power over the coloring of their timestamps as they want.
It is hacky, but *configurably* hacky, and it wouldn't get in the way of
anyone who wants a normal-colored timestamp.

---
Sebastian LaVine | https://smlavine.com

Re: catgirl timestamp colors

From: june
> On Oct 28, 2021, at 16:09, Sebastian LaVine <mail@smlavine.com> wrote:
> 
> Another solution I have thought of and tried is putting ANSI escape
> sequences into my config file, like so:
> 
> 	timestamp = ^[[32m%l:%M%P^[[0m
> 
> With '^[' being an actual escape character. However, this doesn't work.
> Instead, a '^[' -- not the escape character -- is printed in its place,
> along with the rest of the ANSI sequence. I would appreciate it if
> anyone could help me understand why this happens.

ncurses doesn't let raw control characters through, because it needs
to be the one generating them so that it knows what's on the screen.

> I think that if this worked, it would be the best solution. It doesn't
> require another config option and command line option, but gives the
> user as much power over the coloring of their timestamps as they want.
> It is hacky, but *configurably* hacky, and it wouldn't get in the way of
> anyone who wants a normal-colored timestamp.

Rather than terminal control sequences, IRC formatting codes probably
should work in the timestamp string. If people don't mind putting
literal \3's and such in their config, I agree it's not a bad
solution. I'll look into it. I think there's a little fiddling
required to maintain the grey default and calculate the width.

Re: catgirl timestamp colors

From: june
> On Oct 28, 2021, at 17:28, june <june@causal.agency> wrote:
> 
> Rather than terminal control sequences, IRC formatting codes probably
> should work in the timestamp string. If people don't mind putting
> literal \3's and such in their config, I agree it's not a bad
> solution. I'll look into it. I think there's a little fiddling
> required to maintain the grey default and calculate the width.

I've pushed a patch[1] for this. It allows making the timestamps
blue, for instance, by setting "timestamp = ^C02%X" where ^C is a
literal byte 0x03, see [2].

[1]: https://git.causal.agency/catgirl/commit/?id=4363d4b53505708608b1a82f8bff45d7aefe18dc
[2]: https://modern.ircdocs.horse/formatting.html

Re: catgirl timestamp colors

From: Sebastian LaVine
To: june
On Thu Oct 28, 2021 at 6:09 PM EDT, june wrote:
> > On Oct 28, 2021, at 17:28, june <june@causal.agency> wrote:
> > 
> > Rather than terminal control sequences, IRC formatting codes probably
> > should work in the timestamp string. If people don't mind putting
> > literal \3's and such in their config, I agree it's not a bad
> > solution. I'll look into it. I think there's a little fiddling
> > required to maintain the grey default and calculate the width.
>
> I've pushed a patch[1] for this. It allows making the timestamps
> blue, for instance, by setting "timestamp = ^C02%X" where ^C is a
> literal byte 0x03, see [2].
>
> [1]:
> https://git.causal.agency/catgirl/commit/?id=4363d4b53505708608b1a82f8bff45d7aefe18dc
> [2]: https://modern.ircdocs.horse/formatting.html

This works exactly as I want it to. Thank you so much for this,
especially so quickly!

---
Sebastian LaVine | https://smlavine.com
1 reply

Re: catgirl timestamp colors

From: Hoël Bézier
>Hoël, would you be willing to share your patch?
Sure, it’s plain and simple. I’ve attached it to this mail.

Color names list can be found in ui.c, ligne 349, git tag 1.9a.

Note that Gentoo users can land this in /etc/portage/patches/net-irc/catgirl 
and it will be applied automatically whenever net-irc/catgirl is installed or 
updated. If you don’t feel comfortable with applying this to every catgirl 
version (though I believe it’s simple enough for this to be safe), the last 
directory can be named catgirl-1.9a instead of catgirl to restrict it.

Hoël