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

Deprecate and remove colour variables in the configuration file #263

Open
bakkeby opened this issue Jun 20, 2022 · 4 comments
Open

Deprecate and remove colour variables in the configuration file #263

bakkeby opened this issue Jun 20, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@bakkeby
Copy link
Owner

bakkeby commented Jun 20, 2022

The default configuration has a lot of variables to cover for each colour of the many colour schemes, e.g.

static char normfgcolor[]                = "#bbbbbb";
static char normbgcolor[]                = "#222222";
static char normbordercolor[]            = "#444444";
static char normfloatcolor[]             = "#db8fd9";

The main reason why the variables exist is because the base dwm re-uses some of the colours and more importantly because the xrdb patch relies on these variables for overloading the colour strings with data from XResources.

                XRDB_LOAD_COLOR("dwm.normfgcolor", normfgcolor);
                XRDB_LOAD_COLOR("dwm.normbgcolor", normbgcolor);
                XRDB_LOAD_COLOR("dwm.normbordercolor", normbordercolor);
                XRDB_LOAD_COLOR("dwm.normfloatcolor", normfloatcolor);

I would suggest removing the colour variables and instead set the colours directly in the colour schemes instead.

static char *colors[SchemeLast][ColCount] = {
	/*                       fg         bg         border     float      resource prefix */
	[SchemeNorm]         = { "#bbbbbb", "#222222", "#444444", "#db8fd9", "norm" },
	[SchemeSel]          = { "#eeeeee", "#005577", "#005577", "#005577", "sel" },
	...

The resource prefix would then be used in a revamped xrdb patch which would look up normfgcolor, normbgcolor.normbordercolor and normfloatcolor X resources and generate new colours based on that.

The benefit of doing it this way is that:

  • it makes the configuration file a lot more compact and easier to read and
  • it makes the xrdb code simpler to maintain (would not need any changes when a new colour scheme is introduced, just a unique resource prefix)

The drawback of this is that it may be confusing to a lot of people and how xresources works will need to be documented.

A practical example of this can be found in my dusk build.

Feel free to vote on such a change by giving this issue a 👍 or 👎.

@bakkeby bakkeby added the enhancement New feature or request label Jun 20, 2022
@explosion-mental
Copy link

Think I ask u about borders a while back.
I decided to have a hole scheme for it
https://github.com/explosion-mental/demwm/blob/99624bd48fa32f0460fdade64ec02eff70c0c669/config.h#L73

Also, I don't really understand what SchemeNorm floating member will do here. Is it just the border? Selected and not selected border for floating, that's all¿

@bakkeby
Copy link
Owner Author

bakkeby commented Jun 22, 2022

Yes that is just to differentiate the border colour between tiled and floating windows, originates from the float border color patch. I don't particularly like it, but of course it gives more granularity when it comes to colour choices. Personally I think it makes more sense having a separate colour scheme for floating windows.

bakkeby added a commit that referenced this issue Jul 11, 2022
bakkeby added a commit that referenced this issue Aug 3, 2022
@UtkarshVerma
Copy link
Contributor

Any updates on this? Would love to see this get implemented.

@bakkeby
Copy link
Owner Author

bakkeby commented Jan 12, 2023

There is a demonstration on the experimental vertigo branch. It is likely too game breaking to merge into the main dwm-flexipatch.

bakkeby added a commit that referenced this issue Apr 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

3 participants