Util-Linux Archive mirror
 help / color / mirror / Atom feed
From: Dragan Simic <dsimic@manjaro.org>
To: Karel Zak <kzak@redhat.com>
Cc: util-linux@vger.kernel.org
Subject: Re: [RFC] Alternative color configuration for dmesg
Date: Tue, 01 Aug 2023 19:50:34 +0200	[thread overview]
Message-ID: <fd2d84cc464af4ed22e21ea7f678b828@manjaro.org> (raw)
In-Reply-To: <20230801134210.ayct6znedmnh5vhn@ws.net.home>

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.

      reply	other threads:[~2023-08-01 17:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-16 17:32 [RFC] Alternative color configuration for dmesg Dragan Simic
2023-08-01 13:42 ` Karel Zak
2023-08-01 17:50   ` Dragan Simic [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fd2d84cc464af4ed22e21ea7f678b828@manjaro.org \
    --to=dsimic@manjaro.org \
    --cc=kzak@redhat.com \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).