v1cont / yad

Yet Another Dialog
GNU General Public License v3.0
687 stars 57 forks source link

how to create notification icon without starting dbus? #58

Closed bdantas closed 5 years ago

bdantas commented 5 years ago

I'm trying to get rid of dbus on my system. I'm almost there but yad (one of my very favorite utilities) starts dbus when it creates notification icon:

bruno@box:~$ pgrep -fa dbus
bruno@box:~$ yad --notification --image=dialog-ok --text="testing" &
bruno@box:~$ pgrep -fa dbus
8504 dbus-launch --autolaunch b67e35c57ed5e6cf8ef0f5b65da5d7b3 --binary-syntax --close-stderr
8505 /usr/local/bin/dbus-daemon --syslog-only --fork --print-pid 5 --print-address 7 --session
8511 /usr/local/bin/dbus-daemon --config-file=/usr/local/share/defaults/at-spi2/accessibility.conf --nofork --print-address 3

Is it possible for yad to create notification icons without starting dbus?

v1cont commented 5 years ago

is the behavior with dbus the same for other types of yad dialog or dbus started only for notifications?

bdantas commented 5 years ago

Behavior is the same for other types of dialog. Sorry for the misleading issue title (I almost always use yad for notification icons).

Interestingly, yad works fine if I uninstall dbus. So it's puzzling why yad consistently starts dbus if dbus is installed but not already running.

v1cont commented 5 years ago

looks like this is gsettings issue. you can try to build yad with --enable-standalone configure option, but i'm not sure that this will helpful, because gtk3 itself already uses gsettings features for file and color dialogs

bdantas commented 5 years ago

I rebuilt latest git with --enable-standalone and it made no difference.

Using this application (https://github.com/jonhoo/mktrayicon) (compiled against gtk3) to create a notification icon does not cause dbus to start, so I don't think it's a gtk3 issue.

Also, I substituted /usr/local/bin/dbus-launch with a shell script that logs PID and PPID, then launched yad. The log shows me that the parent of dbus-launch is yad, proving that at some point yad itself is calling dbus-launch for some reason.

v1cont commented 5 years ago

try to do "export NO_AT_BRIDGE=1" before running yad

bdantas commented 5 years ago

Yes, now yad runs without starting dbus. Great! Thank you.