XDG_CURRENT_DESKTOP

PCMan pcman.tw at gmail.com
Mon Jul 18 02:41:35 PDT 2011


Agree with this idea.
In our camp, LXDE supports XDG_CURRENT_DESKTOP.
Besides the menu, the environment is also useful elsewhere.
Whenever a desktop entry file is referenced by applications, this
environment variable is needed.
The file managers lookup applications used open files of a mime-type
according to desktop entry spec, too.
We need to hide applications OnlyShownIn other desktops in this case, too.
This apparently has nothing to do with gnome-menu.
Another user of this is xdg-utils. With this environment variable, all
dirty code for desktop detection can be removed from xdg-utils.
Yet another use case of this is for cross-desktop applications. Some
applications may want to have different behavior under different
desktops. A good example is utilities used to set desktop wallpapers.
Adding _set_desktop() APIs in every lib won't fix this issue since
it's still the responsibility of the applications using the libs to
determine current DE and there are no reliable ways to do this. Adding
desktop guessing code to every applications became inevitable if we
don't have a common place to specify desktop environment name.
To sum up, a common and reliable source for every apps and libs to
obtain current desktop name is absolutely needed.
It's even better if this value is not store in dconf. So environment
variable is a pretty good and simple one.

On Fri, Jul 15, 2011 at 12:39 AM, Nick Schermer <nickschermer at gmail.com> wrote:
> In Xfce XDG_CURRENT_DESKTOP is already used in a number of places as
> an override for the default XFCE for {Only,Not}ShowIn. An example can
> be found here [1]. The main purpose in our cases are mostly to make
> the various parts of Xfce easier to use in other environments.
>
> I think no library should ever assume it runs on a specific desktop,
> but only provide the functions for an application to set this (in our
> case garcon_set_environment).
>
> Nick
>
> [1] http://git.xfce.org/xfce/xfce4-panel/tree/plugins/applicationsmenu/applicationsmenu.c#n216
> _______________________________________________
> xdg mailing list
> xdg at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/xdg
>


More information about the xdg mailing list