Xfce Forum

Sub domains
 

You are not logged in.

#1 2016-02-24 12:55:07

Mitt
Member
Registered: 2014-08-05
Posts: 26

Why D-Bus?

Hi,

This may be a very noobish question, please excuse.

Why does Xfce and Xfconf in particular rely on D-Bus? Why not on plain text config files or XML, like in Openbox and LXDE? Say, instead of using Xfce Settings Daemon to change GTK theme create an interface to .gtkrc-2.0 (and settings.ini).

Cheers

Offline

#2 2016-02-24 15:45:12

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,486

Re: Why D-Bus?

Mitt wrote:

This may be a very noobish question, please excuse.

I'll do my best to answer based on what I know - you may get better answers asking directly to the xfce4-dev mailing list.

Why does Xfce and Xfconf in particular rely on D-Bus?

dbus is mostly an interprocess communication (IPC) system - a way for applications to talk to each other. For example, xfce4-power-manager uses dbus for:

In addition, xfce4-power-manager provides a set of freedesktop-compliant DBus interfaces to inform other applications about the current power level so that they can adjust their power consumption, and it provides the inhibit interface which allows applications to prevent automatic sleep actions via the power manager; as an example, the operating system’s package manager should make use of this interface while it is performing update operations.

...source: http://docs.xfce.org/xfce/xfce4-power-manager/start

xfconf (Xfce's configuration storage system) uses dbus so that it can communicate with other Xfce applications when settings are queried and/or changed and need to be tracked/saved (see next section).

Why not on plain text config files or XML, like in Openbox and LXDE?

Actually, Xfce does use xml configuration files. Most of its configurations are stored in xml files in ~/.config/xfce4/xfconf/xfce-prechannel-xml. Xfce, however, uses xfconf as sort of a "live" configuration management system. On startup, the settings in the xml files are read into memory and managed by the xfconfd daemon. It tracks when configuration changes are made and on shutdown, it writes these changes back to the xml files. It saves the user from having to directly manipulate those files.

Say, instead of using Xfce Settings Daemon to change GTK theme create an interface to .gtkrc-2.0 (and settings.ini).

I don't think this will work. ~/.gtkrc-2.0 and settings.ini are only overrides for theme configuration settings. There are many other places where theme properties can be set. The Xfce Settings Daemon sets the theme at the X settings level. Theme properties can still be overriden from there. But this doesn't really have anything to do with dbus - its the GTK method of specifying widget configuration options.

At least, this is how I understand it. Hope it helps.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2016-02-24 20:22:35

Mitt
Member
Registered: 2014-08-05
Posts: 26

Re: Why D-Bus?

Many thanks! +1000 to karma smile

ToZ wrote:

dbus is mostly aninterprocess communication (IPC) system - a way for applications to talk to each other.

I've spent some time reading, what D-Bus is, simply couldn't draw the lines between it and Xfconf. By the way, what happened to fd.o? Around five hours ago the site wasn't working. Now it is.

Actually, Xfce does use xml configuration files. Most of its configurations are stored in xml files in ~/.config/xfce4/xfconf/xfce-prechannel-xml. Xfce, however, uses xfconf as sort of a "live" configuration management system. On startup, the settings in the xml files are read into memory and managed by the xfconfd daemon. It tracks when configuration changes are made and on shutdown, it writes these changes back to the xml files. It saves the user from having to directly manipulate those files.

I've seen these XML files, I meant, they don't work if dbus-daemon hasn't started. I've tried using Xfce, disabling dbus in init, and I got somewhat ugly - no panel theming (or all theming, don't really remember), inability to shutdown or restart, automounting was gone in Thunar.

Thanks again.

Offline

#4 2016-02-24 20:36:58

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,486

Re: Why D-Bus?

Mitt wrote:

I've seen these XML files, I meant, they don't work if dbus-daemon hasn't started. I've tried using Xfce, disabling dbus in init, and I got somewhat ugly - no panel theming (or all theming, don't really remember), inability to shutdown or restart, automounting was gone in Thunar.

Thanks again.

My guess is that without dbus, the Xfce apps can't get their settings from the xfconf daemon (themeing not applied) and apps/processes can't get proper authorizations (from polkit) for things like shutdown or mounting.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#5 2016-02-24 20:49:14

sixsixfive
Member
From: behind you
Registered: 2012-04-08
Posts: 579
Website

Re: Why D-Bus?

d-bus is used for inter process communication as toz mentioned but it has nothing to do with theming

xfconf is like gconf and dconf a ms regedit wannabe, maybe the devs just thought that a gui was better to handle?. I personally like KDEs simple text config files more than messing around with big fat xml files...

themes in xfce are handled by xsettings(for example KDE has no xsettings support so the need to modify the gtkrc to set gtk themes)

also the most things here mentioned are freedesktop specs(like xsettings) however, freedesktop(despite its name) is mainly GNOME and since Xfce is GNOME based it inherits the most of it technics. (eg have a look at Enlightenment, KDE, LXQt or lumina the often use many different ways to handle such stuff)

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.008 seconds, 7 queries executed - Memory usage: 559.73 KiB (Peak: 560.58 KiB) ]