dunst icon indicating copy to clipboard operation
dunst copied to clipboard

use format string for show_age_threshold

Open dicktyr opened this issue 8 years ago • 4 comments

I appreciate the show_age_threshold option but it would nice to have control of the format (to remove the distracting seconds field, for example)

to disable display: show_age_threshold = ""

dicktyr avatar Jan 29 '17 02:01 dicktyr

Similar to #273

tsipinakis avatar Jan 29 '17 13:01 tsipinakis

Looking at this again, I'm not sure how this would work.

Currently we have a if-else-if chain so that we only add the values that are necessary(e.g. hours shouldn't be shown if the notification is less than an hour old).

This does not directly translate to a format string since we can't remove parts of it. For example setting it to "%hhours %mminutes" would display as "0hours 2minutes" if the notification is 2 minutes old.

tsipinakis avatar Feb 12 '17 12:02 tsipinakis

I'm sure I'm not the only one who may prefer a HH:MM:SS format (in which case hours/minutes need not be removed if they are zero)

it seems simple enough to use your existing method by default and simply replace it if the user defines a format string (no need to worry about removing parts) or let the user define all three format strings

dicktyr avatar Feb 13 '17 19:02 dicktyr

i was thinking of a slightly unorthodox format but that can fix this issue

%h{h} %m{m} %s{s} old -> where the {...} part is displayed only if h/m/s is > 0.

for normal time something like

%H:%M:%S could be used instead

bynect avatar Aug 14 '25 16:08 bynect