ogham / exa

A modern replacement for ‘ls’.
https://the.exa.website/
MIT License
23.45k stars 658 forks source link

How to disable bold text in user and group #1203

Open Solarunit opened 1 year ago

Solarunit commented 1 year ago

Is there a way to disable bald text in user and group? Or disable bold text globally for all items?

eggbean commented 1 year ago

Yes, this is one of the first things I changed, as default the user/group colours are way too bright/bold. You can change various things by using the EXA_COLORS variable.

$ man exa_colors

https://github.com/ogham/exa/blob/master/man/exa_colors.5.md

Some of these override the LS_COLORS variable, but I think it's better to use that for files and directories.

If you add this to your .bashrc (or .zshenv in zsh) you will change the colours to something less distracting.

EXA_COLORS='uu=38;5;178:gu=38;5;178:un=38;5;141:gn=38;5;141'

Solarunit commented 1 year ago

Thanks, I added this to .bashrc and nothing changed. I will look at it again later. I wish there was a command option for exa non-bold output..

eggbean commented 1 year ago

Bold and non-bold are defined by your LS_COLORS (and in this case EXA_COLORS) variables. Exa just knows which colours to use and has nothing to do with how they are defined.

Your terminal emulator is likely to have a setting to disable bold characters entirely and use bright colour variants instead, if you would prefer that.

I just tested the EXA_COLOR variable that I gave you. You can see that I cleared the version I use and then listed some files to show you the default and then used the one I gave you were you can see that the owner column is now darker and if the file is owned by another user, a sort of purple.

You need to have your terminal set to at least 256 colours (8-bit) for this to work, but it's unlikely that you haven't got that or 24-bit colours set. You can test if you have 8-bit colours by pasting this (of you have ruby installed):

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/gawin/bash-colors-256/master/colors)"

image

Solarunit commented 1 year ago

On your screenshot it's hard to tell if text is bold or normal. You could add a normal ls -l output for comparison too :) BTW I don't want to change colors at all, just change the font from bold to normal. How do you do that with bold yellow jason jason from 1st ll output?

eggbean commented 1 year ago

It's hard for you to tell as it's quite subtle. If it wasn't subtle it would be unpleasant. Those four lines are bold, as I have "bright colours" set to display as bold, as you obviously have too. As I said, it's likely that the terminal emulator that you use has a setting to disable the display of 'bright' colours as bold.

Terminal are pretty confusing as it's everything's been added on top over many decades. These normal and bright (and, optionally, bold) are from the 4-bit colour days when terminals had 16 colours. 8 normal colours and 8 bright versions of those colours, which can be bold as well to make them more noticable. If you don't like that, disable it. These 16 colours on moderm terminal emulators are customisable and you can change them using 'themes' in the settings. These are mine:

image

You can see the normal and bright foreground colours in the second column. See the bright colours are also bold, as I have it set like that.

Late came 8-bit colour (256 colours) and recently (5/6 years) 24-bit colours (16,777,216 colours). Your terminal is very likely 24-bit capable, but if using he first 16 colours in what you see here...

$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/gawin/bash-colors-256/master/colors)"

...those are the customisable 4-bit, 16 normal/bright colours.

I can't find any easy to understand webpages about this, as it's a messy topic.

https://chrisyeh96.github.io/2020/03/28/terminal-colors.html

Solarunit commented 1 year ago

Ok, I made user and group not bold with this in .bashrc:

export EXA_COLORS="uu=33:gu=33"

Previously I just add EXA_COLORS="uu=33:gu=33" and this doesn't work. https://the.exa.website/docs/colour-themes

I wonder where I can see all default EXA_COLORS for all items?