Open Goosegit11 opened 6 months ago
Could you please advise me which patch affects this? In my st-flexipatch the colors are bright and yours are dim.
There shouldn't be any patches that affect colors except Bold is not bright
patch, so you should be able to change each color via config.def.h or .Xresources.
And what patch is causing the transparency, or what is it?
You can change the transparency here or here. Those default values are coming from Alpha Focus Highlight
patch, but do you think it would be better to disable transparency by default?
Well I have Bold is not bright
patch enabled too. Here is my st-flexipatch configuration:
Also both st-sx and my st use the same .Xresources
:
Also now I see that the only dim color is white. Other colors are the same.
I really can't reproduce your issue. I took your patches.h and .Xresources files and compiled st-flexipatch and didn't notice any difference between st-sx and st-flexipatch. The colors were exactly the same. I even put the colors in the config.h file and I still didn't notice any difference. So there must be something else in your configuration somewhere that affects this.
One thing you could do is try changing the color theme using themes.sh and see if the terminals look the same. If they do, we know we have a configuration issue. If they don't, then I really don't know what's causing the issue because st-sx is patched using st-flexipatch and I haven't changed anything that would affect the colors as far as I can remember.
I tried this theme.sh
thingy, and yeah, colors are the same as in st-sx
.
Then I remembered about the Gruvbox color scheme in config.def.h
.
I thought Xresources patch completely overwrites the color scheme in config.def.h
, but I'm not sure now. What do you think?
First of all, config.def.h
is just a template file and you should never edit it, because st (or any suckless tool) doesn't use it. You should always edit config.h
. It's not there first, so you have to copy config.def.h to config.h manually or just run make
. And after that, edit the file, compile and install the app. I'm pretty sure you know that already, but I just wanted to make sure that we are on the same page.
As for the .Xresources
file, all the settings you define there will overwrite the settings in your config.h
file. So you should be able to completely or partially override the colors if you want to do so.
Are there other settings in your .Xresource file other than the ones above? Are some colors accidentally defined twice? You can run xrdb -query -all
to check if there is anything odd in your Xresource settings.
One thing you could do is try setting the St
class to the color names in your .Xresources file to see if that makes any difference. For example:
St.color0: base00
St.color1: base08
...
See the xresources-example file.
Btw, your config.def.h or config.h snippet doesn't look right because these are missing:
[255] = 0,
/* more colors can be added after 255 to use with DefaultXX */
"#cccccc", /* 256 -> cursor */
"#555555", /* 257 -> rev cursor */
"gray90", /* 258 -> foreground */
"black", /* 259 -> background */
"black", /* 260 -> background unfocused */
I use config.def.h
because that's what patches always modify.
I edit it with my changes, delete config.h
, run sudo make clean install
.
I would be glad if you could tell me if I'm doing something wrong.
By the way:
UPD: I'm sorry, the GIFs came out a little laggy.
Believe me, I'd like to solve this issue too, but I can't reproduce it. Something is missing from the equation.
So, what kind of Zsh plugins are you using? Do you use them with default settings or do you use some customizations?
What happens when you run Bash on both terminals? Do they look the same? You could even try changing the login shell to Bash and then logging out and back in to see if that makes a difference.
I assume you already tried setting the settings in config.h only and not using Xresources at all, and that didn't solve anything?
Cursor color changes when focusing on colored text
It is the dynamic cursor color patch that behaves that way.
I have removed color values from .Xresources
Yes, the colors have changed, in both terminals.
Now st-sx
has the same non-dull white color as my st
.
But there's something wrong with the FG/BG...
And some colors, such as blue and pink, now are a little different, but it doesn't matter, I'll change them later as necessary.
UPD: Firefox says that the video is corrupted so I can't play it in the browser, but downloading and playing it in mpv
works. ¯\(ツ)\\/¯
Tell me if it's not working for you.
https://github.com/veltza/st-sx/assets/89806596/141ffc5b-d842-48af-bce8-e57b234e66f3
A couple of questions/comments besides these already in the video:
00:44
The fastfetch color blocks look different, on my st
they have a weird line inbetween, on the st-sx
they look smoother
00:47
The FG/BG values differ, my st
has Gruvbox FG/BG when st-sx has some kind of "default" values, like pitch black for the background, idk.
01:30
The st-sx
window resizes weirdly, I assume it's the ANYSIZE patch?
02:05 Scrollback works differently, I assume it's the SCROLLBACK_REFLOW patch?
Your video was really helpful because it helped me solve your issue!
First of all, be careful because the colorname
table is not compatible with st-flexipatch. There are small differences at the end of the array:
st-sx
/* more colors can be added after 255 to use with DefaultXX */
"#cccccc", /* 256 -> cursor */
"#555555", /* 257 -> rev cursor */
"gray90", /* 258 -> foreground */
"black", /* 259 -> background */
"black", /* 260 -> background unfocused */
st-flexipatch
/* more colors can be added after 255 to use with DefaultXX */
"#add8e6", /* 256 -> cursor */
"#555555", /* 257 -> rev cursor*/
"#000000", /* 258 -> bg */
"#e5e5e5", /* 259 -> fg */
As you can see, foreground (fg) and background (bg) are reversed. It's because st-sx has two background colors.
But this was not the main issue. The real issue can be found at 1:49 of the video:
I noticed that you had changed the indexes in the defaultbg
, defaultfg
and defaultcs
variables, because the default values in st-flexipatch are these:
unsigned int defaultbg = 258;
#endif // ALPHA_FOCUS_HIGHLIGHT_PATCH
unsigned int defaultfg = 259;
unsigned int defaultcs = 256;
unsigned int defaultrcs = 257;
Since you set defaultbg
to 0, st-flexipatch reads background color from color index 0 and foreground color (defaultfg
) from index 15. But st-sx reads background color from color index 259 (or 260) and foreground color from index 258. So there's the issue!
Is there a particular reason why you want to change those indexes? Because if you change them, you should also change the indexes to the resources array, because otherwise Xresources will set the colors to the wrong color indexes. I recommend that you do not change any indexes as there should be no need to do so.
00:44 The fastfetch color blocks look different, on my st they have a weird line inbetween, on the st-sx they look smoother
I'm not sure, but you could try disabling ligatures and see if that changes anything.
01:30 The st-sx window resizes weirdly, I assume it's the ANYSIZE patch?
It is ANYSIZE_SIMPLE_PATCH and it is intended for window manager users. I can add a setting to disable it if you want.
02:05 Scrollback works differently, I assume it's the SCROLLBACK_REFLOW patch?
Yes, it is.
The alpha blend for st are brighter than for alacritty for example.
Reminds me of this post from a year ago:
That change would look like this in st-flexipatch:
diff --git a/x.c b/x.c
index 06ac5c4..cfa4411 100644
--- a/x.c
+++ b/x.c
@@ -1018,6 +1018,9 @@ xloadcols(void)
dc.col[defaultbg].color.alpha = (unsigned short)(0xffff * alpha);
dc.col[defaultbg].pixel &= 0x00FFFFFF;
dc.col[defaultbg].pixel |= (unsigned char)(0xff * alpha) << 24;
+ dc.col[defaultbg].color.red *= alpha;
+ dc.col[defaultbg].color.green *= alpha;
+ dc.col[defaultbg].color.blue *= alpha;
#endif // ALPHA_PATCH
loaded = 1;
}
@@ -1058,6 +1061,9 @@ xsetcolorname(int x, const char *name)
dc.col[defaultbg].color.alpha = (unsigned short)(0xffff * alpha);
dc.col[defaultbg].pixel &= 0x00FFFFFF;
dc.col[defaultbg].pixel |= (unsigned char)(0xff * alpha) << 24;
+ dc.col[defaultbg].color.red *= alpha;
+ dc.col[defaultbg].color.green *= alpha;
+ dc.col[defaultbg].color.blue *= alpha;
}
#endif // ALPHA_PATCH
return 0;
Personally I think it looks much better.
The alpha blend for st are brighter than for alacritty for example.
I'm surprised that the authors of the patch never noticed or bothered to fix this.
Although the alpha issue does not affect this open issue, it has now been fixed in st-sx.
Could you please advise me which patch affects this? In my st-flexipatch the colors are bright and yours are dim.
By the way, the colors in WezTerm are just as dim.
And what patch is causing the transparency, or what is it?