exa
exa copied to clipboard
Add color themes, similar to bat
Problem
Current exa
0.10.1 offers a pre-defined set of colors for the output, which works very well on terminals with black/dark background.
This color set is inconvenient in the extreme when used on terminals with light (e.g., gray) background. The provided alternative of manually setting every individual color for every possible type of file is better than nothing - but highly taxing for a user that's not an expert in these things, and merely wants different file types to show prominently on his terminal.
Proposal
Other apps, such as bat, face similar problem of coloring the output, not knowing what background user's terminal would have.
I'm asking exa
developers to follow bat
example, and offer the ability to choose color set from a group of sets, such as "Dark", "Light", etc.
For example, here's the set of options that bat
allows. I'm not asking that exa
supports all of them, but at least one option for terminals with light background, and the current color combination that's looking very good on terminals with black background, would be great:

(and a complete list of provided color themes)
$ bat --list-themes
Theme: 1337
// Output the square of a number.
fn print_square(num: f64) {
let result = f64::powf(num, 2.0);
println!("The square of {:.2} is {:.2}.", num, result);
}
Theme: Coldark-Cold
// Output the square of a number.
fn print_square(num: f64) {
let result = f64::powf(num, 2.0);
println!("The square of {:.2} is {:.2}.", num, result);
}
Theme: Coldark-Dark
// Output the square of a number.
fn print_square(num: f64) {
let result = f64::powf(num, 2.0);
println!("The square of {:.2} is {:.2}.", num, result);
}
Theme: DarkNeon
// Output the square of a number.
fn print_square(num: f64) {
let result = f64::powf(num, 2.0);
println!("The square of {:.2} is {:.2}.", num, result);
}
Theme: Dracula
// Output the square of a number.
fn print_square(num: f64) {
let result = f64::powf(num, 2.0);
println!("The square of {:.2} is {:.2}.", num, result);
}
Theme: GitHub
// Output the square of a number.
fn print_square(num: f64) {
let result = f64::powf(num, 2.0);
println!("The square of {:.2} is {:.2}.", num, result);
}
Theme: Monokai Extended
// Output the square of a number.
fn print_square(num: f64) {
let result = f64::powf(num, 2.0);
println!("The square of {:.2} is {:.2}.", num, result);
}
Theme: Monokai Extended Bright
// Output the square of a number.
fn print_square(num: f64) {
let result = f64::powf(num, 2.0);
println!("The square of {:.2} is {:.2}.", num, result);
}
Theme: Monokai Extended Light
// Output the square of a number.
fn print_square(num: f64) {
let result = f64::powf(num, 2.0);
println!("The square of {:.2} is {:.2}.", num, result);
}
Theme: Monokai Extended Origin
// Output the square of a number.
fn print_square(num: f64) {
let result = f64::powf(num, 2.0);
println!("The square of {:.2} is {:.2}.", num, result);
}
Theme: Nord
// Output the square of a number.
fn print_square(num: f64) {
let result = f64::powf(num, 2.0);
println!("The square of {:.2} is {:.2}.", num, result);
}
Theme: OneHalfDark
// Output the square of a number.
fn print_square(num: f64) {
let result = f64::powf(num, 2.0);
println!("The square of {:.2} is {:.2}.", num, result);
}
Theme: OneHalfLight
// Output the square of a number.
fn print_square(num: f64) {
let result = f64::powf(num, 2.0);
println!("The square of {:.2} is {:.2}.", num, result);
}
Theme: Solarized (dark)
// Output the square of a number.
fn print_square(num: f64) {
let result = f64::powf(num, 2.0);
println!("The square of {:.2} is {:.2}.", num, result);
}
Theme: Solarized (light)
// Output the square of a number.
fn print_square(num: f64) {
let result = f64::powf(num, 2.0);
println!("The square of {:.2} is {:.2}.", num, result);
}
Theme: Sublime Snazzy
// Output the square of a number.
fn print_square(num: f64) {
let result = f64::powf(num, 2.0);
println!("The square of {:.2} is {:.2}.", num, result);
}
Theme: TwoDark
// Output the square of a number.
fn print_square(num: f64) {
let result = f64::powf(num, 2.0);
println!("The square of {:.2} is {:.2}.", num, result);
}
Theme: ansi
// Output the square of a number.
fn print_square(num: f64) {
let result = f64::powf(num, 2.0);
println!("The square of {:.2} is {:.2}.", num, result);
}
Theme: base16
// Output the square of a number.
fn print_square(num: f64) {
let result = f64::powf(num, 2.0);
println!("The square of {:.2} is {:.2}.", num, result);
}
Theme: base16-256
// Output the square of a number.
fn print_square(num: f64) {
let result = f64::powf(num, 2.0);
println!("The square of {:.2} is {:.2}.", num, result);
}
Theme: gruvbox-dark
// Output the square of a number.
fn print_square(num: f64) {
let result = f64::powf(num, 2.0);
println!("The square of {:.2} is {:.2}.", num, result);
}
Theme: gruvbox-light
// Output the square of a number.
fn print_square(num: f64) {
let result = f64::powf(num, 2.0);
println!("The square of {:.2} is {:.2}.", num, result);
}
Theme: zenburn
// Output the square of a number.
fn print_square(num: f64) {
let result = f64::powf(num, 2.0);
println!("The square of {:.2} is {:.2}.", num, result);
}
Further themes can be installed to '/Users/ur20980/.config/bat/themes', and are added to the cache with `bat cache --build`. For more information, see:
https://github.com/sharkdp/bat#adding-new-themes
The provided alternative of manually setting every individual color for every possible type of file is better than nothing - but highly taxing for a user that's not an expert in these things, and merely wants different file types to show prominently on his terminal
Have you looked at configuring LS_COLORS for configuring colors for different file types? For example, https://github.com/trapd00r/LS_COLORS.
I haven't - thanks for the pointer. Regardless, LS_COLORS
(as I understand it) does not address my need or this feature request.
- I have different types of terminals - they require different settings.
- I want the ability to select what color scheme the output of a particular invocation would follow.
- Configuring LS_COLORS for "dynamic" environment doesn't appear to be trivial, and I'm trying to simplify user's experience, not make him a master of yet another complicated tool (and if you consider programming in Perl simple - we disagree strongly).
Again, what bat
does is ideal for my use case, and I'd like to see something similar in exa
.
Well, we disagree there. It took me ten minutes to learn how to read/write the LSCOLORS
environment variable. I don't think it's complicated. Plus, there are tons of examples and prefigured LSCOLORS
to choose from out there if you're lazy like me.
I have different types of terminals - they require different settings.
If you want to use multiple terminals on the same machine and user, then LSCOLORS would probably not work for you like you said.
If you want to use multiple terminals on the same machine and user, then LSCOLORS would probably not work for you like you said.
This is the whole point.
Which is why I'm asking for something like --color-theme=
feature.
vivid theme for LS_COLORS is quite easy to use
https://github.com/sharkdp/vivid
@haifengkao I already explained why LS_COLORS
does not work for my use case. Thank you for not being attentive.
You also need to change $EXA_COLORS
to change all the elements of exa's long listing. But once you have spent some time defining that to how you like, there is nothing more you need to do. Everything can be made to be however you like it to be. If you don't want to do that, you can try to find somebody else who has.
I've changed mine to suit my preferences, but it's for a dark background.
https://man.archlinux.org/man/community/exa/exa_colors.5.en
Sorry, I don't think you understood. My environment is dynamic. That makes playing with environment var settings less than desirable.
@mouse07410 I don't understand what is dynamic environment.
LS_COLORS="$(vivid generate molokai)";exa -la
LS_COLORS="$(vivid generate snazzy)";exa -la
LS_COLORS="$(vivid generate nord)";exa -la
You can use any themes you like. Just create an alias and you are all set.
Dynamic - on the same computer same user on different terminals/windows needs different color schemes.
What you proposed with vivid
may work. Manually setting all
the colors for every alias is probably too taxing to consider as a solution, as my users don't want to mess with specifying RGB schemes at all (I agree with them).
Making a bash script that does this would take ten minutes. Having such themes in exa isn't likely to be something anyone else would be interested in.
@mouse07410 You overestimate your problem. There is no difference between "exa
supports color themes" and "you write a bash function to wrap exa
and vivid
together.
@mouse07410 your proposed solution also wouldn't work for "dynamic" workspace, i.e. on the same computer same user on different terminals/windows needs different color schemes. User would still have to manually set the theme via --theme
every time.
And if you're saying that's ok, then I don't see a reason why LS_COLORS="$(vivid generate molokai)"
isn't also ok. It's the same amount of manual work...
I must say the snark on display in this thread is disheartening.
I personally like the proposal, not because it is less work for the user, but simply because it feels nice and clean. Unfortunately, @mouse07410's attitude towards everyone that has objected to it is off-putting in the extreme and sours the whole enterprise.
Can't we all just get along? 🎸 ☮️ ✌️