public inbox for util-linux@vger.kernel.org
 help / color / mirror / Atom feed
* global fdisk colors disable
@ 2014-01-15  6:47 Felix Miata
  2014-01-15  8:27 ` Karel Zak
  0 siblings, 1 reply; 11+ messages in thread
From: Felix Miata @ 2014-01-15  6:47 UTC (permalink / raw)
  To: util-linux

Is there a way to do $SUBJECT? One really shouldn't have to resort to using 
-L on every invocation to be able to see fdisk output. I see nothing in the 
man page about any kind of config file. I don't think there's ever been a 
reason to configure it before.
-- 
"The wise are known for their understanding, and pleasant
words are persuasive." Proverbs 16:21 (New Living Translation)

   Team OS/2 ** Reg. Linux User #211409 ** a11y rocks!

Felix Miata  ***  http://fm.no-ip.com/



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

* Re: global fdisk colors disable
  2014-01-15  6:47 global fdisk colors disable Felix Miata
@ 2014-01-15  8:27 ` Karel Zak
  2014-01-15  9:30   ` Pádraig Brady
  2014-01-15 14:10   ` Felix Miata
  0 siblings, 2 replies; 11+ messages in thread
From: Karel Zak @ 2014-01-15  8:27 UTC (permalink / raw)
  To: Felix Miata; +Cc: util-linux, Pádraig Brady

On Wed, Jan 15, 2014 at 01:47:40AM -0500, Felix Miata wrote:
> Is there a way to do $SUBJECT? One really shouldn't have to resort to using
> -L on every invocation to be able to see fdisk output. 

 Does it mean that fdisk output is broken or you just don't like
 colors? You can use:

   alias fdisk=fdisk -L=never

 in your shell profile or rc file.

> I see nothing in the
> man page about any kind of config file. I don't think there's ever been a
> reason to configure it before.

 Well, I guess that more people prefer colorized output so this
 feature is enabled by default.


 I have already thought about it and it would be probably nice to have
 a way how to globally configure colors for all command line utils
 (e.g.  util-linux, coreutils, ...).
 
 It seems we have no standard and package  independent solution now,
 so distributions use things like "alias" in shell profile files (for
 example for ls(1), grep(1), ...). It would be nice to have at least
 global variable (something like COLOR_MODE={auto,never,always}) to
 avoid aliases with --color= option. (CC: Padraig ;-)

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

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

* Re: global fdisk colors disable
  2014-01-15  8:27 ` Karel Zak
@ 2014-01-15  9:30   ` Pádraig Brady
  2014-01-15 10:24     ` Karel Zak
  2014-01-15 14:14     ` Felix Miata
  2014-01-15 14:10   ` Felix Miata
  1 sibling, 2 replies; 11+ messages in thread
From: Pádraig Brady @ 2014-01-15  9:30 UTC (permalink / raw)
  To: Karel Zak; +Cc: Felix Miata, util-linux

On 01/15/2014 08:27 AM, Karel Zak wrote:
> On Wed, Jan 15, 2014 at 01:47:40AM -0500, Felix Miata wrote:
>> Is there a way to do $SUBJECT? One really shouldn't have to resort to using
>> -L on every invocation to be able to see fdisk output. 
> 
>  Does it mean that fdisk output is broken or you just don't like
>  colors? You can use:
> 
>    alias fdisk=fdisk -L=never
> 
>  in your shell profile or rc file.
> 
>> I see nothing in the
>> man page about any kind of config file. I don't think there's ever been a
>> reason to configure it before.
> 
>  Well, I guess that more people prefer colorized output so this
>  feature is enabled by default.
> 
> 
>  I have already thought about it and it would be probably nice to have
>  a way how to globally configure colors for all command line utils
>  (e.g.  util-linux, coreutils, ...).
>  
>  It seems we have no standard and package  independent solution now,
>  so distributions use things like "alias" in shell profile files (for
>  example for ls(1), grep(1), ...). It would be nice to have at least
>  global variable (something like COLOR_MODE={auto,never,always}) to
>  avoid aliases with --color= option. (CC: Padraig ;-)

I think the current mechanism used is best.
I.E. default to showing colors when possible but give an option to disable.
Global env vars come with their own disadvantages.

However I will say that one has to be careful when using colors,
and the use in fdisk seems a bit redundant. I.E. colors are useful
to distinguish things, like the portion of a match in grep or
the type of a file in ls. I'm not sure the items distinguished
in fdisk non obvious and worth the hassle of worrying about color.

thanks,
Pádraig.

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

* Re: global fdisk colors disable
  2014-01-15  9:30   ` Pádraig Brady
@ 2014-01-15 10:24     ` Karel Zak
  2014-01-15 14:14     ` Felix Miata
  1 sibling, 0 replies; 11+ messages in thread
From: Karel Zak @ 2014-01-15 10:24 UTC (permalink / raw)
  To: Pádraig Brady; +Cc: Felix Miata, util-linux

On Wed, Jan 15, 2014 at 09:30:19AM +0000, Pádraig Brady wrote:
> On 01/15/2014 08:27 AM, Karel Zak wrote:
> > On Wed, Jan 15, 2014 at 01:47:40AM -0500, Felix Miata wrote:
> >> Is there a way to do $SUBJECT? One really shouldn't have to resort to using
> >> -L on every invocation to be able to see fdisk output. 
> > 
> >  Does it mean that fdisk output is broken or you just don't like
> >  colors? You can use:
> > 
> >    alias fdisk=fdisk -L=never
> > 
> >  in your shell profile or rc file.
> > 
> >> I see nothing in the
> >> man page about any kind of config file. I don't think there's ever been a
> >> reason to configure it before.
> > 
> >  Well, I guess that more people prefer colorized output so this
> >  feature is enabled by default.
> > 
> > 
> >  I have already thought about it and it would be probably nice to have
> >  a way how to globally configure colors for all command line utils
> >  (e.g.  util-linux, coreutils, ...).
> >  
> >  It seems we have no standard and package  independent solution now,
> >  so distributions use things like "alias" in shell profile files (for
> >  example for ls(1), grep(1), ...). It would be nice to have at least
> >  global variable (something like COLOR_MODE={auto,never,always}) to
> >  avoid aliases with --color= option. (CC: Padraig ;-)
> 
> I think the current mechanism used is best.
> I.E. default to showing colors when possible but give an option to disable.

As I made note on g+, on many places is the default not to show colors,
so we all have --color=auto aliases in shell profile files :-)

BTW, dmesg supports colors, but it's disabled by default -- what about
to enable it by default? (I don't want to add Fedora specific 
/etc/profile.d/colordmesg.sh ...).

> Global env vars come with their own disadvantages.

Yes.

> However I will say that one has to be careful when using colors,
> and the use in fdisk seems a bit redundant. I.E. colors are useful
> to distinguish things, like the portion of a match in grep or
> the type of a file in ls. I'm not sure the items distinguished

That's exactly how fdisk uses colors :-) The another story are warning
and error messages, my experience is that people don't read it, so now
it's in red.

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

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

* Re: global fdisk colors disable
  2014-01-15  8:27 ` Karel Zak
  2014-01-15  9:30   ` Pádraig Brady
@ 2014-01-15 14:10   ` Felix Miata
  2014-01-15 15:21     ` Mike Frysinger
  2014-01-15 17:11     ` Karel Zak
  1 sibling, 2 replies; 11+ messages in thread
From: Felix Miata @ 2014-01-15 14:10 UTC (permalink / raw)
  Cc: util-linux

On 2014-01-15 09:27 (GMT+0100) Karel Zak composed:

> On Wed, Jan 15, 2014 at 01:47:40AM -0500, Felix Miata wrote:

>> Is there a way to do $SUBJECT? One really shouldn't have to resort to using
>> -L on every invocation to be able to see fdisk output.

>   Does it mean that fdisk output is broken or you just don't like
>   colors? You can use:

How about I defer answering that until you look at this image I should have 
included in my OP:

http://fm.no-ip.com/SS/colorsTTYbadFdisk.png

I hope you can understand the problem this way. It's much like web page 
designers have taken to doing the past few years, trying to be "helpful" by 
using gray text instead of black, ostensibly to compensate for harshness of 
maladjusted displays without considering impact on correctly adjusted displays.

Exactly what in that image is the non-default color supposed to be conveying?

>     alias fdisk=fdisk -L=never

>   in your shell profile or rc file.

That seems to have ignored a keyword in $SUBJECT: global

I have many logins on many installations. In what global config file (e.g. 
Debian, Fedora, Gentoo, Knoppix, Mageia, openSUSE, Slackware, etc.) can I 
make never the default for all users?

>> I see nothing in the
>> man page about any kind of config file. I don't think there's ever been a
>> reason to configure it before.

>   Well, I guess that more people prefer colorized output so this
>   feature is enabled by default.

Colors that have a standard meaning in a common context can make sense, but 
as likely colors confuse, besides reducing contrast. cf.:

http://en.wikipedia.org/wiki/Wikipedia:WikiProject_Usability/Color "Colors 
must be used carefully..."

http://www.webdesignref.com/chapters/13/ch13-16.htm "To avoid color contrast 
problems, white and black always make a good pairing..."

http://usabilitygeek.com/12-typography-guidelines-for-good-website-usability/ 
"Avoid colouring text in red or green..."

Orange on a 16 color display doesn't look much different than red. Both 
contrast poorly unless the background is white, detracting from any value as 
warning intended by those color choices.

>   I have already thought about it and it would be probably nice to have
>   a way how to globally configure colors for all command line utils
>   (e.g.  util-linux, coreutils, ...).

I'm pretty sure all other utils I commonly use have a way to turn off color 
globally. Some utils don't, so I don't use them unless no alternative exists. 
There really is no practical alternative to fdisk -l that I'm aware of.

>   It seems we have no standard and package  independent solution now,
>   so distributions use things like "alias" in shell profile files (for
>   example for ls(1), grep(1), ...). It would be nice to have at least
>   global variable (something like COLOR_MODE={auto,never,always}) to
>   avoid aliases with --color= option. (CC: Padraig ;-)

One reason I use the ttys is for comfort, a pleasant environment where 
legibility is maximized, in part by big bold text, in part by lack of 
distraction from other windows and widgets, in other part by using only the 
two colors of my choice. In that environment I don't want or need to be 
"warned" by colors I can barely see.

Maybe what I need is a way to prevent framebuffer ttys
  from using any but the two colors of my choice. Anyone know if that's possible?
-- 
"The wise are known for their understanding, and pleasant
words are persuasive." Proverbs 16:21 (New Living Translation)

  Team OS/2 ** Reg. Linux User #211409 ** a11y rocks!

Felix Miata  ***  http://fm.no-ip.com/

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

* Re: global fdisk colors disable
  2014-01-15  9:30   ` Pádraig Brady
  2014-01-15 10:24     ` Karel Zak
@ 2014-01-15 14:14     ` Felix Miata
  1 sibling, 0 replies; 11+ messages in thread
From: Felix Miata @ 2014-01-15 14:14 UTC (permalink / raw)
  To: util-linux

On 2014-01-15 09:30 (GMT) Pádraig Brady composed:

> I think the current mechanism used is best.

What mechanism are you referring to, needing an override switch on every 
invocation on an alien system?

> I.E. default to showing colors when possible but give an option to disable.

$SUBJECT Keyword: global.

> Global env vars come with their own disadvantages.

+1

> However I will say that one has to be careful when using colors,

Exactly.

> and the use in fdisk seems a bit redundant.

I think orthogonal is the better word than redundant.

> I.E. colors are useful
> to distinguish things, like the portion of a match in grep or
> the type of a file in ls. I'm not sure the items distinguished
> in fdisk non obvious and worth the hassle of worrying about color.

Indeed.
-- 
"The wise are known for their understanding, and pleasant
words are persuasive." Proverbs 16:21 (New Living Translation)

  Team OS/2 ** Reg. Linux User #211409 ** a11y rocks!

Felix Miata  ***  http://fm.no-ip.com/

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

* Re: global fdisk colors disable
  2014-01-15 14:10   ` Felix Miata
@ 2014-01-15 15:21     ` Mike Frysinger
  2014-01-16  9:24       ` Felix Miata
  2014-01-15 17:11     ` Karel Zak
  1 sibling, 1 reply; 11+ messages in thread
From: Mike Frysinger @ 2014-01-15 15:21 UTC (permalink / raw)
  To: Felix Miata, util-linux

[-- Attachment #1: Type: Text/Plain, Size: 468 bytes --]

On Wednesday 15 January 2014 09:10:19 Felix Miata wrote:
> I have many logins on many installations. In what global config file (e.g.
> Debian, Fedora, Gentoo, Knoppix, Mageia, openSUSE, Slackware, etc.) can I
> make never the default for all users?

/etc/profile

or use ~/.bashrc and set up a system that syncs your ~/ files

if there was an env var, you could configure ~/.ssh/config to forward specific 
env vars to the remote host automatically
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: global fdisk colors disable
  2014-01-15 14:10   ` Felix Miata
  2014-01-15 15:21     ` Mike Frysinger
@ 2014-01-15 17:11     ` Karel Zak
  2014-01-16  9:06       ` Felix Miata
  1 sibling, 1 reply; 11+ messages in thread
From: Karel Zak @ 2014-01-15 17:11 UTC (permalink / raw)
  To: Felix Miata; +Cc: util-linux

On Wed, Jan 15, 2014 at 09:10:19AM -0500, Felix Miata wrote:
> On 2014-01-15 09:27 (GMT+0100) Karel Zak composed:
> 
> >On Wed, Jan 15, 2014 at 01:47:40AM -0500, Felix Miata wrote:
> 
> >>Is there a way to do $SUBJECT? One really shouldn't have to resort to using
> >>-L on every invocation to be able to see fdisk output.
> 
> >  Does it mean that fdisk output is broken or you just don't like
> >  colors? You can use:
> 
> How about I defer answering that until you look at this image I should have
> included in my OP:
> 
> http://fm.no-ip.com/SS/colorsTTYbadFdisk.png

 Well, for me is the output pretty readable, but I understand that
 for someone else it could be difficult.

 If I run "xterm -bg blue -fg white" then ls(1) output on Fedora is
 absolutely useless, does it mean that coreutils/Fedora use stupid
 defaults?

> Exactly what in that image is the non-default color supposed to be conveying?

 make the header more readable ;-)

> >    alias fdisk=fdisk -L=never
> 
> >  in your shell profile or rc file.
> 
> That seems to have ignored a keyword in $SUBJECT: global

 I don't think so.

> I have many logins on many installations. In what global config file (e.g.
> Debian, Fedora, Gentoo, Knoppix, Mageia, openSUSE, Slackware, etc.) can I
> make never the default for all users?

 depends on distro... for example /etc/profile.d/*

> Orange on a 16 color display doesn't look much different than red. Both
> contrast poorly unless the background is white, detracting from any value as
> warning intended by those color choices.

 so your suggestion is to disable the colors at all for all Linux boxes by
 default? 
 
 I understand your point of view, but I'd like to use default that is
 usable to majority of the Linux users.

> >  I have already thought about it and it would be probably nice to have
> >  a way how to globally configure colors for all command line utils
> >  (e.g.  util-linux, coreutils, ...).
> 
> I'm pretty sure all other utils I commonly use have a way to turn off color
> globally. Some utils don't, so I don't use them unless no alternative
> exists. There really is no practical alternative to fdisk -l that I'm aware
> of.

 See the problem from opposite side -- for example grep and ls have
 disabled colors by default, so many distributions have things like:

         alias egrep='egrep --color=tty'
         alias fgrep='fgrep --color=tty'
         alias grep='grep --color=tty'
         alias l.='ls -d .* --color=auto'
         alias ll='ls -l --color=auto'
         alias ls='ls --color=auto'

 in /etc/profile.d/ to overwrite the default...
 
> >  It seems we have no standard and package  independent solution now,
> >  so distributions use things like "alias" in shell profile files (for
> >  example for ls(1), grep(1), ...). It would be nice to have at least
> >  global variable (something like COLOR_MODE={auto,never,always}) to
> >  avoid aliases with --color= option. (CC: Padraig ;-)
> 
> One reason I use the ttys is for comfort, a pleasant environment where
> legibility is maximized, in part by big bold text, in part by lack of
> distraction from other windows and widgets, in other part by using only the
> two colors of my choice. In that environment I don't want or need to be
> "warned" by colors I can barely see.

 I understand.. it would be nice to have a one place to disable/enable
 colors for all terminal utils, maybe something like
 
    /etc/terminal-colors.d/[<utilname>.]disable

 I'm going to resolve the problem for the next v2.25. Thanks!

  Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

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

* Re: global fdisk colors disable
  2014-01-15 17:11     ` Karel Zak
@ 2014-01-16  9:06       ` Felix Miata
  0 siblings, 0 replies; 11+ messages in thread
From: Felix Miata @ 2014-01-16  9:06 UTC (permalink / raw)
  To: util-linux

On 2014-01-15 18:11 (GMT+0100) Karel Zak composed:

> On Wed, Jan 15, 2014 at 09:10:19AM -0500, Felix Miata wrote:

>> Orange on a 16 color display doesn't look much different than red. Both
>> contrast poorly unless the background is white, detracting from any value as
>> warning intended by those color choices.

>   so your suggestion is to disable the colors at all for all Linux boxes by
>   default?

I've been using white on blue text modes for nearly 3 decades, ever since I 
learned to use ansi to set screen colors in DOS 3, as I find white on black 
rather unpleasant to need to use more than occasionally.

Probably better to have some option for a user or admin to force the ttys 
into 2 or 4 color mode regardless whether the system is capable of or 
happiest with 8, 15, 16, 24 or more.

>   I understand your point of view, but I'd like to use default that is
>   usable to majority of the Linux users.

That is a typical majority rule effect. The problem is those with poorer than 
average vision by definition are both a minority and handicapped. From that 
it apparently follows that making it more difficult for the minority already 
handicapped must be OK because the majority of average or better people might 
enjoy some colors that may or may not make sense or provide real enhancement.

>> One reason I use the ttys is for comfort, a pleasant environment where
>> legibility is maximized, in part by big bold text, in part by lack of
>> distraction from other windows and widgets, in other part by using only the
>> two colors of my choice. In that environment I don't want or need to be
>> "warned" by colors I can barely see.

>   I understand.. it would be nice to have a one place to disable/enable
>   colors for all terminal utils, maybe something like

>      /etc/terminal-colors.d/[<utilname>.]disable

>   I'm going to resolve the problem for the next v2.25. Thanks!

Thank you! This sounds like it should be a good option for many.
-- 
"The wise are known for their understanding, and pleasant
words are persuasive." Proverbs 16:21 (New Living Translation)

  Team OS/2 ** Reg. Linux User #211409 ** a11y rocks!

Felix Miata  ***  http://fm.no-ip.com/

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

* Re: global fdisk colors disable
  2014-01-15 15:21     ` Mike Frysinger
@ 2014-01-16  9:24       ` Felix Miata
  2014-01-16  9:59         ` Karel Zak
  0 siblings, 1 reply; 11+ messages in thread
From: Felix Miata @ 2014-01-16  9:24 UTC (permalink / raw)
  To: util-linux

On 2014-01-15 10:21 (GMT-0500) Mike Frysinger composed:

> On Wednesday 15 January 2014 09:10:19 Felix Miata wrote:

>> I have many logins on many installations. In what global config file (e.g.
>> Debian, Fedora, Gentoo, Knoppix, Mageia, openSUSE, Slackware, etc.) can I
>> make never the default for all users?

> /etc/profile

That always seems to have a rather recent date, even though I never touch it. 
Are you sure you don't mean /etc/profile.local?

> or use ~/.bashrc and set up a system that syncs your ~/ files

Too complicated for me. I don't use identical .bashrc content for every login 
or every installation. Earlier in thread Karel Zak indicated he has a nice 
solution planned for next release.

> if there was an env var, you could configure ~/.ssh/config to forward specific
> env vars to the remote host automatically
-- 
"The wise are known for their understanding, and pleasant
words are persuasive." Proverbs 16:21 (New Living Translation)

  Team OS/2 ** Reg. Linux User #211409 ** a11y rocks!

Felix Miata  ***  http://fm.no-ip.com/

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

* Re: global fdisk colors disable
  2014-01-16  9:24       ` Felix Miata
@ 2014-01-16  9:59         ` Karel Zak
  0 siblings, 0 replies; 11+ messages in thread
From: Karel Zak @ 2014-01-16  9:59 UTC (permalink / raw)
  To: Felix Miata; +Cc: util-linux

On Thu, Jan 16, 2014 at 04:24:18AM -0500, Felix Miata wrote:
> On 2014-01-15 10:21 (GMT-0500) Mike Frysinger composed:
> 
> >On Wednesday 15 January 2014 09:10:19 Felix Miata wrote:
> 
> >>I have many logins on many installations. In what global config file (e.g.
> >>Debian, Fedora, Gentoo, Knoppix, Mageia, openSUSE, Slackware, etc.) can I
> >>make never the default for all users?
> 
> >/etc/profile
> 
> That always seems to have a rather recent date, even though I never touch
> it. Are you sure you don't mean /etc/profile.local?

For example Fedora uses /etc/profile where is:

for i in /etc/profile.d/*.sh ; do
    if [ -r "$i" ]; then
        if [ "${-#*i}" != "$-" ]; then 
            . "$i"
        else
            . "$i" >/dev/null
        fi
    fi
done


and in the /etc/profile.d/ directory are many scripts, for example
/etc/profile.d/colorls.sh with --color=auto alias for ls(1).

It's pretty common that people and packages add/modify the stuff in 
the /etc/profile.d/ directory.

IMHO it's elegant way how to maintain global configuration for shells.

The files like ~/.bash_profile are users' playground and I don't think
that good admin touches these ~/ files.

    Karel


-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

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

end of thread, other threads:[~2014-01-16  9:59 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-15  6:47 global fdisk colors disable Felix Miata
2014-01-15  8:27 ` Karel Zak
2014-01-15  9:30   ` Pádraig Brady
2014-01-15 10:24     ` Karel Zak
2014-01-15 14:14     ` Felix Miata
2014-01-15 14:10   ` Felix Miata
2014-01-15 15:21     ` Mike Frysinger
2014-01-16  9:24       ` Felix Miata
2014-01-16  9:59         ` Karel Zak
2014-01-15 17:11     ` Karel Zak
2014-01-16  9:06       ` Felix Miata

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox