dunst icon indicating copy to clipboard operation
dunst copied to clipboard

Box-shadow support for notifications?

Open svetixoxo opened this issue 3 months ago • 7 comments

Hi there,

I was wondering if there is currently any support for adding a box-shadow (or similar effect) to notifications in Dunst? I think this would be a great visual enhancement, especially on modern desktop setups where a bit of shadow can help separate notifications from the background.

  • I’ve looked through the documentation and issues, but couldn’t find anything definitive. #926 #1289
  • Is this something that’s already possible via a workaround or configuration hack?
  • Or has it perhaps been implemented recently in a way I missed?

If not, are there any technical reasons this isn’t feasible, or would it be worth considering as a feature request?

svetixoxo avatar Sep 19 '25 05:09 svetixoxo

dunst itself cannot draw shadows now. but you can use a compositor effect to do that, for example picom supports that.

bynect avatar Sep 19 '25 10:09 bynect

Thanks for the helpful hint! picom won't work for me, because it is for Xorg only and will not run on wayland, but I will look more into compositor effects and try to find something suitable for my setup.

svetixoxo avatar Sep 21 '25 19:09 svetixoxo

dunst itself cannot draw shadows now. but you can use a compositor effect to do that, for example picom supports that.

I wanted to do this for Hyprland, but it seems it only supports shadows for windows, but not shell layers. It expects the shell layer to be responsible for drawing its own shadows.

I thought about implementing the shadow myself, but it seems cairo doesn't have gaussian blur support (it's been on the roadmap since 2016).

CelDaemon avatar Oct 12 '25 17:10 CelDaemon

there is this example of theirs: https://www.cairographics.org/cookbook/blur.c/

Though I don't know if its the best way to do it. Anyway, shadows are definitely in the #1289 list.

bynect avatar Oct 13 '25 08:10 bynect

there is this example of theirs: https://www.cairographics.org/cookbook/blur.c/

That example seems to be a software solution to blurring using an image surface. Looks promising, but at first glance I'm a bit concerned about performance. It might be fine if the surface can be reused though.

CelDaemon avatar Oct 13 '25 12:10 CelDaemon

I feel like this should be something to be implemented on the compositor itself and not the notification. As @CelDaemon mentioned, having the notif handling the shadow could lead to performance issues.

FrenzyExists avatar Nov 23 '25 10:11 FrenzyExists

I agree that using a software-based blur on image surfaces could introduce performance issues, especially for frequently updated notifications (for example changing audio volume or display brightness).

For a simple drop shadow effect, would it not be more efficient to just:

  1. Draw a solid or gradient-filled shape (rectangle with rounded corners matching the notification)
  2. Offset it by a few pixels
  3. Set it to a semi-transparent or solid color (for example rgba(0, 0, 0, 0.3))
  4. Render it behind the notification

This would be a simple fill operation (just setting pixels to a specific color instead of blur calculations).

svetixoxo avatar Nov 23 '25 11:11 svetixoxo