Giter Site home page Giter Site logo

Opacity issue about st HOT 14 CLOSED

lukesmithxyz avatar lukesmithxyz commented on July 17, 2024
Opacity issue

from st.

Comments (14)

 avatar commented on July 17, 2024 1

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

from st.

LukeSmithxyz avatar LukeSmithxyz commented on July 17, 2024

You can't change the transparency of a window already spawned.

Or are you saying that new windows are non-transparent?

from st.

bsimic avatar bsimic commented on July 17, 2024

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)

from st.

LukeSmithxyz avatar LukeSmithxyz commented on July 17, 2024

Do you have a composite manager running?

from st.

bsimic avatar bsimic commented on July 17, 2024

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.

from st.

LukeSmithxyz avatar LukeSmithxyz commented on July 17, 2024

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?

from st.

bsimic avatar bsimic commented on July 17, 2024

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.

from st.

bsimic avatar bsimic commented on July 17, 2024

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.

from st.

 avatar commented on July 17, 2024

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

from st.

bsimic avatar bsimic commented on July 17, 2024

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.

from st.

GotekSC avatar GotekSC commented on July 17, 2024

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:

from st.

GotekSC avatar GotekSC commented on July 17, 2024

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.

from st.

bsimic avatar bsimic commented on July 17, 2024

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.

from st.

nickfarrow avatar nickfarrow commented on July 17, 2024

@pRot0ta1p 's solution worked for me!

opacity-rule = [ "90:class_g = 'St'" ]; in ~/.config/compton.conf was a nice workaround.

from st.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.