d99kris / nchat

Terminal-based Telegram / WhatsApp client for Linux and macOS
MIT License
619 stars 43 forks source link

[Enhancement] Per user colors #65

Closed rendiix closed 1 year ago

rendiix commented 2 years ago

In group chats, it's making it quite hard to distinguish who's who.

Even in 1on1 chats, it can get confusing.

Any way we can have random colors (or even predefined) colors on a user basis?

d99kris commented 2 years ago

Yeah, this has crossed my mind before too. Will take a look.

Note to self: Check how official Telegram client selects color - getColorForId?

d99kris commented 1 year ago

Do you have any example of terminal-based chat app that implements "per user color" with a nice UI? Would only the name have the special color, or both name and message text?

I'm thinking to start test out some implementation, and I'll google to check what other chat apps do, just thought I'd ask in case you know some good example.

rendiix commented 1 year ago

this is an example of a telegram cli that has implemented a per user color.

python-tg

d99kris commented 1 year ago

Cool, thanks 👍

rendiix commented 1 year ago

Cool, thanks 👍

Thanks for your hard work. I really like your project because it's really fast on my old machine

d99kris commented 1 year ago

Support for unique user colors in group chats has been added now. You can enable it for example by using the Basic Color Theme:

cp /usr/local/share/nchat/themes/basic-color/* ~/.nchat/

More specifically, nchat now supports the value usercolor for parameters history_name_recv_group_color and history_text_recv_group_color. When in group chats usercolor will be picked from ~/.nchat/usercolor.conf based on a hash of the user id. Thus the actual colors used can be configured by editing that file (usercolor.conf).

Please let me know if you encounter any issues.

rendiix commented 1 year ago

@d99kris it works perfectly. thanks for the hard work

rendiix commented 1 year ago

per user color not working, has anyone experienced the same thing?

Screenshot_2022-12-19-12-06-12-858_com termux Screenshot_2022-12-19-12-07-05-287-edit_com termux

d99kris commented 1 year ago

Hi @rendiix - would it be correct to say per-user colors works on some of your systems, and not on some others?

Could you please share a copy of ~/.nchat/log.txt after starting / stopping nchat on the machine were you see the problem?

rendiix commented 1 year ago

@d99kris Yes, per-user color in the last version didn't work on my machine. Previous version had no problem.

I run it on Android using Termux.

log.txt

d99kris commented 1 year ago

Thanks 👍 Hm, no obvious hints from the log.txt.

Could you perhaps share a copy of your ~/.nchat/color.conf and ~/.nchat/usercolor.conf as well?

I don't have a working Termux installation at the moment, so I cannot easily test your setup, but per-user color is working for me on Ubuntu and macOS with latest nchat.

rendiix commented 1 year ago

My config file is not changed the same as provided by nchat by default.

this is precompiled nchat for termux arm64

nchat_3.17_aarch64.zip

rendiix commented 1 year ago

Solved by installing the latest version of Termux, the crash comes from the Termux application itself.

d99kris commented 1 year ago

I assume the color problem was solved as well with latest Termux. Good to hear it worked out.