SietsevanderMolen/i3-qubes

Have border and text colours be configurable

Closed this issue · 6 comments

https://github.com/SietsevanderMolen/i3-qubes/blob/qubes-3.1/i3/0001-Show-qubes-domain-in-non-optional-colored-borders.patch

I would love it if the border and text (especially text) colours could be made configurable, like with http://i3wm.org/docs/userguide.html#_changing_colors, for each label.

I believe this requires

  • adding the new config options to i3/include/config.h
  • also to the APPLY_COLORS section in i3/src/config_directives.c
  • adding default values to INIT_COLOR section in i3/src/config.c
  • and obviously, writing logic to use this in i3/src/x.c

To clarify, ones specified here:

case 0: // dom0
    p->color->text = get_colorpixel("#ffffff");
    p->color->background = get_colorpixel(in_focus ? "#474747" : "#303030");
    break;
case 1: // red
    p->color->text = get_colorpixel("#000000");
    p->color->background = get_colorpixel(in_focus ? "#ff0000" : "#ba0000");
    break;
case 2: // orange
    p->color->text = get_colorpixel("#0059FF");
    p->color->background = get_colorpixel(in_focus ? "#ffa500" : "#b87700");
    break;
case 3: // yellow
    p->color->text = get_colorpixel("#000000");
    p->color->background = get_colorpixel(in_focus ? "#ffff00" : "#baba00");
    break;
case 4: // green
    p->color->text = get_colorpixel("#ffffff");
    p->color->background = get_colorpixel(in_focus ? "#347235" : "#214822");
    break;
case 5: // gray
    p->color->text = get_colorpixel("#ffffff");
    p->color->background = get_colorpixel(in_focus ? "#777775" : "#5d5d5b");
    break;
case 6: // blue
    p->color->text = get_colorpixel("#000000");
    p->color->background = get_colorpixel(in_focus ? "#1e5ef3" : "#133b98");
    break;
case 7: // purple
    p->color->text = get_colorpixel("#ffffff");
    p->color->background = get_colorpixel(in_focus ? "#9a219b" : "#621562");
    break;
case 8: // black
   p->color->text = get_colorpixel("#ffffff");
   p->color->background = get_colorpixel(in_focus ? "#2f2f2f" : "#000000");
   break;

Even though I agree that would be cool, I didn't add it for security reasons. The colours are important to be able to distinguish between domains visually. Making the colours configurable allows the user to override or even hide them, which could be dangerous. The latest Qubes version doesn't allow this behaviour either.

The main use case I have in mind, and why I want it, is changing the shade of the border colour to better suit personal preference, as well as changing the text colour (which is something I would especially like to change).

Making it configurable would allow a user to set them all to the same thing, or something like that, but doing so is a pretty deliberate action, so I'm not sure it should necessarily be a reason to not implement this.

A user who wishes to do this, is already familiar with i3, which less savvy individuals tend not to be, and has presumably read the documentation page, with its warnings, and then installed i3 from the testing repository (though ideally it would eventually be in the main repo, so the testing comment isn't necessarily the most valid).

They would then, to know the configuration options to use, would have had to have read some form of documentation: either the Qubes one or perhaps eventually the man page, which itself may have warnings about the security properties of the border colours.

Considering how deliberate an action it would be to make the colours not map to VM labels, is it necessarily a reason to not allow this (and if a user was that determined, they could either use unpatched i3 or remove or alter the colour component of the patches)?

It's obvious to me why you'd want to change the colours, the default bright red and yellow are super ugly, but I think you are overestimating the security insight of the average user here. In my opinion, i3-qubes shouldn't mess with the security systems that Qubes puts in place. If you need it, I can help you patch your personal i3-qubes to have the colours you want, but I won't make the colours configurable before this is configurable in Qubes itself.

Hrm. I see your point, and perhaps I am.

With changing the colours for my installation, thanks for the offer 😊; I'm able to do that myself though.

Hey @SietsevanderMolen,

thank you first and foremost for the awesome work of porting i3 to Qubes OS. A combination of two fantastic things! 👍

While I totally understand your arguments regarding security, I think there is another issue lurking here, more towards accessibility. I observed some discussions on the issue tracker of Qubes itself regarding this:

QubesOS/qubes-issues#2523
QubesOS/qubes-issues#2646

Overall, it seems like since R4, the colors are configurable at least via XML interface. They seem to agree that configurable colors are important not so much from a style or pleasantness perspective but more from the accessibility aspect. That the picked colors are distinguishable by each and every user is a false assumption.

Given the discussions on the Qubes OS tracker, would you reconsider your standpoint?

Again, many thanks for your contributions!

Hey,

My repo diverted a bit from the QubesOS one, I'll fix it soon, I promise. :-) @Dhole did some great work on adding configurable colors here. That should work for you out of the box. Is that what you meant?

I've been out of the loop a bit on the dev side of Qubes things, but I think I saw the API return the actual colour code recently. If that's used then I feel like i3-qubes should honour that too, to sort of unify the Qubes window managers a little. I'll take a look at it soon when I have a bit more time.

Thanks!