Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow customizing size scale colours. #607

Merged
merged 2 commits into from
Jan 19, 2020

Conversation

de-vri-es
Copy link
Contributor

This PR allows the colours used for file sizes and their units to be configured using EXA_COLORS. It adds 10 new configuration keys for that.

The PR also adjust the selection of the colour depending on the scale used. With decimal prefixes colours change on powers of 1000. With binary or no prefixes colours change on powers of 1024.

This is a different approach to solving #425. It's orthogonal to #370. That PR changes the built-in colors, this PR makes them user configurable.

I personally have one big worry with this PR: the number of two letter combinations for configuration keys isn't that big, and this adds 10 of them. There's more things in exa that I'd like to be user configurable that currently aren't, but finding logical two-letter codes for them may become hard.

I was considering simply using a different environment variable (like EXA_SIZE_COLORS), but that seemed like something to discuss first. Advantage is that it can use the same parse code and doesn't need filesystem access like a configuration file would. And it does add a namespace to avoid conflicts with future options. The config keys could even be longer than two letters in a different environment variable.

Another option could be to come up with a syntax that allows for configuration keys longer than 2 letters in EXA_COLORS, but that seems more difficult.

Also adjust the selection of the colour depending on the scale used.
 * With decimal prefixes colours change on powers of 1000.
 * With binary or no prefixes colours change on powers of 1024.
@de-vri-es
Copy link
Contributor Author

Here's a picture of what can look like the way I would like to configure it:

exa-configure-scale-colors

@ogham
Copy link
Owner

ogham commented Jan 19, 2020

Thank you for this! It's in line with what I was looking for with this feature. I want to make a lot more of the interface configurable too, so one way or another, these styles would have ended up with two-letter codes.

I personally have one big worry with this PR: the number of two letter combinations for configuration keys isn't that big, and this adds 10 of them. There's more things in exa that I'd like to be user configurable that currently aren't, but finding logical two-letter codes for them may become hard.

I agree. My game plan for the EXA_COLORS environment variable is to keep adding codes for UI elements until the situation becomes unwieldy, at which point it will be time to switch to something else. There has to be something better than one long string of numbers and symbols, but until more things are made configurable, I don't want to switch to something that might not end up being the right way. Having multiple environment variables is an interesting idea!

@ogham ogham merged commit 9da3a46 into ogham:master Jan 19, 2020
@de-vri-es
Copy link
Contributor Author

Cool, thanks for the review and merge :)

@ariasuni
Copy link
Collaborator

It fixes #607 I guess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants