Re: How to detect a gtk desktop programmatically



The best you can do is have a mapping of common DEs to their preferred
toolkits

This would mean each Gtk-based DE will require a patch to OpenJDK, which is unsustainable. 

There is no such thing as GTK desktop

Wikipedia has its own category: https://en.wikipedia.org/wiki/Category:Desktop_environments_based_on_GTK

In regards to Gtk2 versus Gtk3 binding, those issues haven't changed as results of this missing variable.  To request an environmental variable which exposes this is a reasonable request.  I'm not sure I understand the reluctance to provide such information.



On Wed, Apr 29, 2020 at 4:46 PM <jtojnar gmail com> wrote:
On Wed, 2020-04-29 at 15:59 -0400, Tres Finocchiaro via desktop-devel-
list wrote:
> I'm asking how to detect a Gtk desktop.  An answer that says "always'
> isn't really correct.  The use-cases for this -- as indicated by the
> Debian search results in the commit that removed this flag -- were in
> the hundreds.

There is no such thing as GTK desktop. Some desktops like GNOME or
Pantheon use GTK 3 a lot, others like KDE or LXQt use predominantly Qt,
but that is more of a social custom than technical feature that can be
detected.

For lot of environments it is not even clear cut as that: Xfce only
just recently managed to migrate most of its apps to GTK 3 but some
still remain on GTK 2, Deepin has weird mix of GTK, Qt and other
things, Enligthenment uses its own EFL… And that is not mentioning the
tens of “light” WMs/DMs like Openbox, Sway or XMonad that have no
toolkit at all and rely purely on user’s preferences.

The best you can do is have a mapping of common DEs to their preferred
toolkits but, as Ray mentions, given that you only support GTK and
¿Motif?, all modern Linux DEs (e.g. those that set the
`XDG_CURRENT_DESKTOP` variable to something) will prefer GTK when
available. Though it is good idea to add an environment variable like
`JAVA_AWT_TOOLKIT` so that people can switch to Motif if they for some
reason do want to use that.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]