dunst-project / dunst

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

Listening on a different name #1190

Closed ohnekopf closed 6 months ago

ohnekopf commented 11 months ago

Hi! just a question/request. I want to use dunst for an application, but i dont want to force the users of that application to use a completely new desktop notification program just for it. would it be possible to add a command line option or something to run dunst but on a different address other than org.freedesktop.Notifications?


i went ahead and tried recompiling dunst with these changes:

--- a/src/dbus.c
+++ b/src/dbus.c
@@ -13,9 +13,9 @@
 #include "settings.h"
 #include "utils.h"

-#define FDN_PATH "/org/freedesktop/Notifications"
-#define FDN_IFAC "org.freedesktop.Notifications"
-#define FDN_NAME "org.freedesktop.Notifications"
+#define FDN_PATH "/org/foobar/Notifications"
+#define FDN_IFAC "org.foobar.Notifications"
+#define FDN_NAME "org.foobar.Notifications"

 GDBusConnection *dbus_conn;

and then sending a notification with:

gdbus call --session   --dest=org.foobar.Notifications   --object-path=/org/foobar/Notifications   --method=org.foobar.Notifications.Notify   ""   0   "icon name"   "summary"   "body message"   '[]'   '{"urgency": <1>}'   5000

and it seems to works (while in parallel with normal dunst running in the background). Now i dunno if i really need to change all the FDN_XXX variables for this to work (i dont really understand dbus tbh) Anyway, it would be nice to be able to set this stuff from the command line for maximum flexibility.

bebehei commented 11 months ago

IIRC, this is everything you need to change.

... but what's your point? It's like adding another door handle on your door. Nobody will press it, the old one is still there and still works.

ohnekopf commented 11 months ago

... but what's your point? It's like adding another door handle on your door. Nobody will press it, the old one is still there and still works.

well, my idea was to allow users to keep whatever desktop notification daemon they have intact, but also run dunst in parallel for something more specific. (the app i made simply uses dunst as a sort of popup for translations). i want this because i dont want my app to be intrusive, but also i want to target dunst and not any other desktop notification daemon because i like dunst's features that other daemons might not have, like history, or maybe the daemon cant handle the kind of input I need correctly.
Maybe this is a stupid solution lol but idk

bebehei commented 11 months ago

This is totally out of scope of the notification spec. I don't see, why this should be supported by dunst.