Dunst: Set maximum notification height

Created on 24 Apr 2019  路  10Comments  路  Source: dunst-project/dunst

Not an issue, question

Is there a way to cut off text instead of displaying all of the text?
It can be quite cumbersome to display a whole stupidly long message :/

Feature

Most helpful comment

@apoorv569 @advilm
It seems like there is a lot of demand for this feature, so I think we should probably implement it, although it will take some time to do it correctly. I agree with @tsipinakis that the best way to implement this would be to add an option to limit the maximum notification height. This will probably be enabled by default and I think it should include limiting the icon size as well.

All 10 comments

There isn't currently. The closest thing is the DUNST_NOTIF_MAX_CHARS constant but that's set at compile time and it's there more to prevent a client making dunst hog the CPU by sending a giant notification.

That being said I wouldn't mind adding such a feature with if there is a convincing use-case. Can you go into a bit more detail on what types of notifications you're looking to truncate?

The most compelling case for this is when recieving whole code blocks in a single message from discord or other messenger. Takes up the entire 1080p's vertical height.

That makes sense. Have you tried using geometry and shrink to restrict notification size or is there a reason it doesn't work?

I honestly have very little idea how to properly customize dunst, but i did try shrink and the geomety.

geometry = "300x2-30+20"
shrink = yes

Results in
image

You're right, I tried a few combinations and there doesn't seem to be a way to set a hard limit. word_wrap = no would achieve this but then you're limited to a single line.

I'd be open to implementing this but in my opinion this should be in the form of a max_height and not a character limit, to fit with the plans in #336 , and to avoid variables like font size and spacing.

Max height would be a nice solution, I would like it to add a trailing elipsis if at all possible, but that's up to you if you wish.

There's already the ellipsize setting for adding ellipsis when the notification is truncated (currently only happens when word_wrap is off).

So this would ideally work in the same way

The solution is actually to avoid Discord like the plague, and instead hang out in IRC where (most) people have the sense to instead post a link to a paste. :wink: :smile:

The solution is actually to avoid Discord like the plague, and instead hang out in IRC where (most) people have the sense to instead post a link to a paste. 馃槈 馃槃

Well I do not think that this is a solution, because it is not only discord. kde-connect for example is also a candidate which notification-text includes whole email-texts etc.

So avoiding such programs just so that Dunst behaves right is the wrong solution.

@apoorv569 @advilm
It seems like there is a lot of demand for this feature, so I think we should probably implement it, although it will take some time to do it correctly. I agree with @tsipinakis that the best way to implement this would be to add an option to limit the maximum notification height. This will probably be enabled by default and I think it should include limiting the icon size as well.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mrmoroshkin picture mrmoroshkin  路  4Comments

bebehei picture bebehei  路  4Comments

existme picture existme  路  4Comments

ahjstone picture ahjstone  路  4Comments

Kaligule picture Kaligule  路  5Comments