dunst icon indicating copy to clipboard operation
dunst copied to clipboard

Allow setting individual border's properties

Open keogami opened this issue 1 year ago • 6 comments

Hello, i am trying to rice dunst's notification borders and would like to customize the properties of a particular edge. In particular, i am trying to achieve the following look image

Reading the docs, i get the impression that this is not currently possible. But I believe it will be a good feature to allow customizing the:

  1. Width of individual borders
  2. Color of individual borders
  3. And perhaps, the dash style for individual borders

keogami avatar Jan 04 '23 00:01 keogami

It's indeed not possible to customize individual borders. I believe mako does support that if you run wayland.

It shouldn't be too hard to implement. If anyone wants to implement this, it's good to know how the configuration would look like. Do you have suggestions on that?

fwsmit avatar Jan 04 '23 14:01 fwsmit

Thank you for responding this quickly. I am not a C programmer but reading the code (draw.c), it does seem easy to implement.

One way is to keep the frame_width setting and add more properties like frame_right_width, frame_left_width. Setting frame_width sets all the borders.

However i would argue that frame_width is not the best term to describe borders. So, i suggest we use properties from css.

border_right_width = 4
border_right_color = "#rrggbb"
# border_width = 2 will override the previous settings

so on so fourth.

Since deprecating frame_* will be a breaking change, for now we can make them an alias for border_*.

keogami avatar Jan 04 '23 15:01 keogami

Instead of adding a new setting key you could also change frame_width to allow a list of numbers. E.g.

frame_width= (1,2,3,4) # set all borders individually
frame_width=1 # set all borders at once

It would also be good to look at mako's configuration to see how they do it. I believe they do something similar.

fwsmit avatar Jan 04 '23 18:01 fwsmit

Hmm that sounds like a good solution but dunst allows overriding settings based on urgency and rules (if i understand this correctly). So, consider the case where all the borders have been set to have some colors like

# (I'm assuming the order as: top right bottom left)
frame_color = ("red", "red", "blue", "blue") # for example

now, if for certain urgency and rules, someone wants to adjust the bottom and left borders they will have to restate top and right for no reason

frame_color  = ("red", "red", "black", "black")

And they will have to do that for every special rule they make and urgency. Which is a bad experience and a lot of copy/pasting for no reason.

Having separate settings for each border won't have theses issues.

keogami avatar Jan 04 '23 21:01 keogami

That's true. You could also allow empty values for keeping the old color:

frame_color = ( , , , "red")

But yeah, it could be discussed more when someone wants to implement it :)

fwsmit avatar Jan 04 '23 22:01 fwsmit

I am planning an overhaul of dunst frame drawing

bynect avatar Mar 05 '24 09:03 bynect