[Portland] Fwd: [Desktop_architects] Querying desktop settings like default browser and proxy configuration

PCMan pcman.tw at gmail.com
Thu Jul 30 22:14:54 PDT 2009

Previously I proposed a way to handle this.
We have a common dir named /etc/xdg-utils/xdg-settings.d or something.
Then, each desktop environment install their own wrapper script into this dir.
For example:
50 is the priority of the script.
Each script installed in this dir is executed one by one.
50-gnome-settings detects if current DE is gnome.
If the answer is yes, it reads gconf, and return 0.
Otherwise, it returns 1.

If 0 is returned, the query is succeeded, so the other scripts are skipped.
If 50-gnome-settings fails, the next one in the list, 50-kde-settings
is executed.
The script checks if current DE is KDE, and if yes, it returns kde
config value. Otherwise it return error code.
They are executed one by one, until one of them succeeded.

Extensibility: Each desktop environments can install their own
detection script in xdg-utils dir.
Scalability: If you don't have XFCE installed, there won't be useless
XFCE detection since the detection script is installed by the DEs
themselves and if XFCE is not installed, there won't be xfce-settings
Maintainability: The developers of xdg-utils don't need to main all
the scripts. They are maintained by the DEs themselves.
Compatibility: This approach won't break anything that already works now.

No, except we need to rewrite several parts of xdg-utils. Otherwise
there is no side effect.

An even better way is letting each DEs install their detection script
in /etc/xdg-utils/detect.d like:

So the detect scripts are executed first to find out which DE we are
in. Then we can select and execute scripts specific to this DE for
xdg-settings, xdg-mime, xdg-open, ...etc.
This can make things much simpler.

On Fri, Jul 31, 2009 at 12:51 PM, Dan Kegel<dank at kegel.com> wrote:
> On Thu, Jul 30, 2009 at 9:28 PM, PCMan<pcman.tw at gmail.com> wrote:
>> A common configuration system is needed.
> But is, alas, beyond the scope of Portland.   I think it would
> merit its own freedesktop.org spec, or something.  Is
> http://www.freedesktop.org/wiki/Specifications/config-spec
> still alive?
>> Wrapper scripts seem to solve the problem partially for now in a dirty way.
> That's the tao of xdg-utils: take simple scripts that are being used
> in real life to solve desktop integration problems, clean them up,
> make them fairly universal, and ship them.
>> In the long run, however, this can only cause more problems and make
>> things more complicated. How can you deal with desktop environments
>> other than Gnome and KDE?
> Add 'em to the script.
>> It's PORTland, not GNOME/KDEland. How about other desktop
>> environments? Problems should be solved in a really cross-desktop way.
> How about them?  You find 'em, we'll add 'em to the script.
> The xdg-settings prototype is just something we cooked up
> for Chrome.  I don't think it's the final word.  I'd love to see
> a common configuration backend for everyone, too.  That's
> a bigger problem than xdg-utils aka Portland was meant to solve, though.
> - Dan

More information about the Portland mailing list