dunst-project / dunst

Lightweight and customizable notification daemon
https://dunst-project.org
Other
4.63k stars 342 forks source link

Feature Request: Configurable "dunstctl close" Behavior #846

Open S-u-b opened 3 years ago

S-u-b commented 3 years ago

According to dunstctl's help output:

$ dunstctl --help
  close                             Close the *last* notification

It's unclear in which sense "last" is being used here, until one reads the man page:

$ man 1 dunstctl
...
       close
           Close the *topmost* notification currently being displayed.
...

I'd like to propose new global option being made available to control whether the "first" vs "last" or "topmost" vs "bottommost" notification is closed: "close_order" (or go with whatever you prefer). Once implemented, if generating notifications as follows: notify-send 1 notify-send 2 notify-send 3 notify-send 4 notify-send 5

...produces these notification results: 1 2 3 4 5

Then setting the close_order option to "top" or "last" closes the oldest notification when dunstctl close is run: 1 2 3 4 5

While setting the close_order option to "bottom" or "first" closes the oldest notification when dunstctl close is run: 1 2 3 4 5

fwsmit commented 3 years ago

Good point! This will be relevant when #845 is implemented, since the topmost notification may not be the last one. I would probably go with the name close_priority with the options of top, bottom, old(est), new(est).

vincentbernat commented 1 year ago

Related, it could be convenient to filter by date too. I want to close notifications older than 1 hour for example. I was looking at doing it myself, but it seems there is no way to list current notifications or get their characteristics. Adding a NotificationListDisplayed, NotificationListWaiting, NotificationClose (with ID) DBus calls would help.