netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH iproute2 1/1] man: Document COLORFGBG environment variable
@ 2019-02-21 15:04 Petr Vorel
  2019-02-21 18:09 ` Stephen Hemminger
  0 siblings, 1 reply; 3+ messages in thread
From: Petr Vorel @ 2019-02-21 15:04 UTC (permalink / raw)
  To: netdev; +Cc: Petr Vorel, Stephen Hemminger

Default colors are not contrast enough on dark backround
and this functionality, which uses more suitable colors
is hidden in the code.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 man/man8/ip.8 | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/man/man8/ip.8 b/man/man8/ip.8
index 84ade110..133d40d5 100644
--- a/man/man8/ip.8
+++ b/man/man8/ip.8
@@ -189,6 +189,12 @@ precedence. This flag is ignored if
 .B \-json
 is also given.
 
+Used color palette can be influenced by
+.BR COLORFGBG
+environment variable
+(see
+.BR ENVIRONMENT ).
+
 .TP
 .BR "\-t" , " \-timestamp"
 display current time when using monitor option.
@@ -330,6 +336,17 @@ Usually it is
 or, if the objects of this class cannot be listed,
 .BR "help" .
 
+.SH ENVIRONMENT
+.TP
+.B COLORFGBG
+If set, it's value is used for detection whether background is dark or light and use contrast colors for it.
+
+COLORFGBG environment variable usually contains either two or three
+values separated by semicolons; we want the last value in either case.
+If this value is 0-6 or 8, chose colors suitable for dark background:
+
+COLORFGBG=";0" ip -c a
+
 .SH EXIT STATUS
 Exit status is 0 if command was successful, and 1 if there is a syntax error.
 If an error was reported by the kernel exit status is 2.
-- 
2.12.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH iproute2 1/1] man: Document COLORFGBG environment variable
  2019-02-21 15:04 [PATCH iproute2 1/1] man: Document COLORFGBG environment variable Petr Vorel
@ 2019-02-21 18:09 ` Stephen Hemminger
  2019-02-25 21:38   ` Petr Vorel
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Hemminger @ 2019-02-21 18:09 UTC (permalink / raw)
  To: Petr Vorel; +Cc: netdev

On Thu, 21 Feb 2019 16:04:01 +0100
Petr Vorel <pvorel@suse.cz> wrote:

> Default colors are not contrast enough on dark backround
> and this functionality, which uses more suitable colors
> is hidden in the code.
> 
> Signed-off-by: Petr Vorel <pvorel@suse.cz>

COLORFGBG is a semi-standard thing used by many programs.
Maybe a reference to a more complete description of it on the web
might be better.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH iproute2 1/1] man: Document COLORFGBG environment variable
  2019-02-21 18:09 ` Stephen Hemminger
@ 2019-02-25 21:38   ` Petr Vorel
  0 siblings, 0 replies; 3+ messages in thread
From: Petr Vorel @ 2019-02-25 21:38 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev

Hi Stephen,

> > Default colors are not contrast enough on dark backround
> > and this functionality, which uses more suitable colors
> > is hidden in the code.

> > Signed-off-by: Petr Vorel <pvorel@suse.cz>

> COLORFGBG is a semi-standard thing used by many programs.
> Maybe a reference to a more complete description of it on the web
> might be better.
If there is any, I'd have added the link instead :).
So I used the description from the code I got inspiration when adding COLORFGBG
support into iproute2. This description is actually complete for our usage of
the variable. If you don't like it, even mentioning COLORFGBG in man would be
better than nothing (one would look into the source).
People have asked for it before [1].

Kind regards,
Petr

[1] https://patchwork.ozlabs.org/patch/814394/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-02-25 21:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-21 15:04 [PATCH iproute2 1/1] man: Document COLORFGBG environment variable Petr Vorel
2019-02-21 18:09 ` Stephen Hemminger
2019-02-25 21:38   ` Petr Vorel

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 NNTP newsgroup(s).