dunst icon indicating copy to clipboard operation
dunst copied to clipboard

Use `transparency` when color transparency is not set

Open titaniumtraveler opened this issue 10 months ago • 6 comments

Motivation

A friend looking into using dunst got confused about transparency option being marked as X11 only, which led us to discussing the issue and me having the idea of why not use transparency as fallback on wayland if the transparency is not set for a color.

That would also make writing cross-(wayland/X11) configs and upgrading to wayland much nicer.

Proposed Idea

On wayland default colors that don't set the A part of #RGBA to the value of transparency. ((100 - transparency) * 0x100 / 100) to be specific)

Alternatives

Make the documentation clearer. For example with

- transparency (default: 0) (X11 only)
+ transparency (default: 0) (X11 only, for wayland see COLORS)

When people see that the option is for X11 only, it is likely they don't even bother reading the content.

Related issues

  • #1252

titaniumtraveler avatar Feb 12 '25 13:02 titaniumtraveler

I am the friend: seeing that option be x11 only made me assume that dunst cannot do transparency overall. with some other issues I had with dunst, it made me go look for other tools instead. fixing at least the doc comment on this would maybe make me (i.e. someone else in the future) stay longer

Axlefublr avatar Feb 12 '25 14:02 Axlefublr

thanks for the heads up. I will improve the documentation. the transparency option is kinda discouraged (as I also said in #1252) since you can set the individual colors' alpha without relying on well-behaved wm.

bynect avatar Feb 12 '25 18:02 bynect

the transparency option is kinda discouraged (as I also said in #1252) since you can set the individual colors' alpha without relying on well-behaved wm.

Yeah, that is fair. I still think that having some option to set the "default" transparency would be pretty useful.

Maybe have something like color_default_transparency(or maybe just default_transparency)? Having to set a specific transparency for every single color sounds like a pain ...

titaniumtraveler avatar Feb 12 '25 19:02 titaniumtraveler

the problem is that the behavior on wayland and xorg would then be different if we keep using the transparency settings. despite it's name what it does is set the _NET_WM_OPACITY hint for the window manager. maybe adding another option would work, we'll see 👍🏻

bynect avatar Feb 13 '25 14:02 bynect

I was thinking that maybe adding a second option wouldn't be too problematic after all. something like default_alpha. the color parsing should be modified a bit though

bynect avatar Apr 30 '25 07:04 bynect

nice to hear it seems more viable than previously!

Axlefublr avatar Apr 30 '25 08:04 Axlefublr