Closed bsimic closed 5 years ago
You can't change the transparency of a window already spawned.
Or are you saying that new windows are non-transparent?
The complete st terminal is non-transparent. I want to set a default value for the complete st terminal, but the value I declare in .Xresources is not being used. (even after closing the terminal, rebooting, recompiling etc etc)
Do you have a composite manager running?
Yep, using compton with i3. The transparency worked when using different terminals. I've switched to st when I found your build today (thank you very much for that btw) and everything is perfect except the opacity.
Okay. I'm not sure why this isn't working then. What distro and all do you have? Does the transparency work if you don't run xrdb
, but put it in ~/.Xdefaults
instead?
You don't by any chance have anything else that might later be affecting xresources?
I'm using Manjaro with the i3-gaps wm. I tried both ~/.Xdefaults and ~/.Xresources and none of those work. I don't think that anything else is affecting those files, as I didn't use them up until now.
I'm not sure if it matters but when I tried to set a bind in i3 config using "st -e ranger" to open ranger, the opacity shows in a new st instance with ranger opened. When I changed the value in .Xdefaults the opacity changed for that instance.
maybe you should set st opacity in compton config, like
opacity-rule = [
"99:class_g = 'st' && !_NET_WM_STATE@:32a",
"99:class_g = 'st'",
];
99 is no opacity, 0 is full transparent
Oh hey, sorry for not answering for a couple of days, but I was nowhere near my laptop. I added the aforementioned setttings to compton config but nothing happened. I am really not sure why the opacity won't change.
I have the same exact problem. I also set the st.alpha: 191
value in .Xresources
, am also running i3-gaps on manjaro, and opacity is working with urxvt and xfce4-terminal.
But with your st build opacity won't work, neither with compton, nor xcompmgr.
Also, similar to
I'm not sure if it matters but when I tried to set a bind in i3 config using "st -e ranger" to open ranger, the opacity shows in a new st instance with ranger opened. [...]
When I start st by st -e <any-tui-app>
it has opacity, but it's more opaque than urxvt, which I control with wpgtk, and is set to 75 (%). For reference again: I set st.alpha: 191
which should be close to 75% opacity.
EDIT:
I later found out, that the line (cat $HOME/.config/wpg/sequences &)
(im a wpgtk user) in .bashrc
(or (cat ~/.cache/wal/sequences &)
for pywal users) makes the terminals completely opaque.
I suspect this has to do with what Luke said in the README.md
Note that when you run
wal
, it will negate the transparency of existing windows, but new windows will continue with the previously defined transparency. As these lines "run" wal specific to the terminal everytime you launch one, I presume.
So, without that line the behavior I described above (opacity when st -e <any-tui-app>
), is now global, but st still doesn't react to the value I set in st.alpha:
I got alpha and .Xresources working with a 0.8.2 build with the newest alpha and xresources patches applied by changing some lines in the resources[] array:
ResourcePref resources[] = {
{ "background", STRING, &colorname[258] },
{ "foreground", STRING, &colorname[257] },
{ "cursorColor", STRING, &colorname[256] },
{ "alpha", FLOAT, &alpha },
};
Note: { "alpha", FLOAT, &alpha },
would now require a number between 0
and 1
set for the st.alpha:
variable in .Xresources
The documentation on the pywal wiki brought me to this idea:
NOTE: this #include would not work with alpha patch. If you want to make it work with alpha patch, you have to change colors-wal-st.h such that defaultbg is set to 257, defaultfg is set to 256. This creates light theme. For dark theme, the color represented by 256 and 257 must be swapped with each other.
As a result, it works with wpgt for me, without the #include that's recommended on the pywal wiki, and should work the same for pywal. It also works with:
I later found out, that the line
(cat $HOME/.config/wpg/sequences &)
(im a wpgtk user) in .bashrc (or(cat ~/.cache/wal/sequences &)
for pywal users) makes the terminals completely opaque.
What's funny though, is, I tried forking this repo, making the same changes to it and doing a pull request for @LukeSmithxyz to implement the change, but again, it wouldn't work. The background would stay completely opaque. I have no idea why.
here is my setup
in .Xresources
*.font: Source Code Pro:pixelsize=22:antialias=true:autohint=true;
Emacs.alpha: 100
*.alpha: 255
in compton.conf
inactive-opacity = 0.7;
active-opacity = 0.9;
frame-opacity = 1;
inactive-opacity-override = false;
and no setting in opacity-rule section for st.
is seems the global alpha value can control the alpha of st, and the active/inactive-opacity setting in compton.conf will have priority over the *.alpha
also note that some gui application will only accept alpha less than 100, so they need a their own alpha value in Xresouces
Hey guys, thanks for the input. I am still not sure what caused the issue, but just wanted to report that it was strictly tied to my system, as when I changed my shell to zsh, st terminal started being transparent.
@pRot0ta1p 's solution worked for me!
opacity-rule = [ "90:class_g = 'St'" ];
in ~/.config/compton.conf
was a nice workaround.
Hello,
I have added the entry:
st.alpha: 100
to my .Xresources file and ran
xrdb .Xresources
but my st terminal is still fully opaque.
Any ideas?