jbuchermn / newm

Wayland compositor
MIT License
960 stars 30 forks source link

Transparent windows #101

Closed fedoranvar closed 2 years ago

fedoranvar commented 2 years ago

Good day to you!

Is there an option in rules to make windows transparent? (opacity)

Thank you!

jbuchermn commented 2 years ago

At the moment this isn't possible, as transparent windows don't make that much sense, only transparent backgrounds - and that is configured for each app individually. Works nicely with e.g. alacritty.

But it would not be much work to add this feature so if you have a use case I can take a look into adding it

ccelik97 commented 2 years ago

A comfortable degree of transparency coupled with an acrylic-like blur would be dope as an optional feature (even if not as a part of the core project, as a plug-in maybe?), rather than leaving all that to the individual apps themselves which might or might not care to provide such an option.

jbuchermn commented 2 years ago

Yeah, I get that. Although I do think most apps, for which it makes sense (especially terminals), support such a thing.

The thing is, the compositor doesn't know about foreground and background. So adding this leads to the whole window (including text) being transparent.

ccelik97 commented 2 years ago

this leads to the whole window (including text) being transparent.

It's fine as long as it's an optional feature (and believe it or not, some people actually want even that to-us-undesirable side effect xd). I think if you can make it configurable per app (whitelist/blacklist style) it'll be fine.Also think about a future possibility like the compositor being able to detect texts and apply different visual effects (as in, to at least not make them too transparent compared to the window background panels etc).

jbuchermn commented 2 years ago

You can now set opacity analogously to blur using rules:

def rules(view):
    if view.app_id == "chromium-browser":
        return { 'opacity': 0.5 }
ccelik97 commented 2 years ago

Nice. Will there be a whitelist/blacklist style approach and/or is it already possible to be done now?

jbuchermn commented 2 years ago

That‘s the way view.rules works - it's just a function, you can use whatever criterion you want to decide whether or not a view should be transparent.

Closing this for now.