Allow customizing size scale colours. #607
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.