On 2023-08-01 15:42, Karel Zak wrote:
Hi,
Hello! :)
On Sun, Jul 16, 2023 at 07:32:03PM +0200, Dragan Simic wrote:
I'd like to implement support for an additional, alternative way for
the
color configuration in the dmesg utility. It would use an environment
variable to store the color configuration, in a way rather similar to
what
grep(1) does using the GREP_COLORS environment variable.
frankly, terminal-colors.d has been implemented to avoid environment
variables :-)
Anyway, I have nothing against support for <util>_COLORS= if it will
be implemented into lib/colors.c and the code will work together.
For example if terminal-colors.d/*.disable will force application to
ignore <util>_COLORS= too.
The ideal solution will be if the env.variable will be just another
way how to specify color scheme (alternative to .scheme file).
Great, thanks! That's exactly what I had in mind: the DMESG_COLORS
environment variable would/will be just another way to specify the color
scheme, and will work in parallel to the already existing
terminal-colors.d mechanism. That will keep the already existing
terminal-colors.d option intact for those who prefer configuration
files, and add another option for those who prefer environment
variables.
Maybe also follow conventions used by terminal-colors.d, it means
scheme, enable and disable options, for example:
DMESG_COLORS=disable
DMESG_COLORS=enable
DMESG_COLORS=alart:37;41,warning:37;42
(not sure about the format, this just brain-storming ... ;-)
That's exactly what I had in mind, :) to have the DMESG_COLORS
environment variable reuse the disable/enable/scheme value layout,
employed by the already existing terminal-colors.d mechanism. That will
keep the things uniform across the two different color-scheme options.
I'll move forward and start implementing this patch, following the
approach we've agreed upon.