Re: How to detect a gtk desktop programmatically



That's an unfortunate truth which is why I was hoping for an alternative way to detect this.
At time of writing this, Ubuntu's the only one I've found modifying XDG_CURRENT_DESKTOP and keep something indicative of Gtk inside e.g. (ubuntu:GNOME).

Nothing about "ubuntu:GNOME" is "indicative of Gtk", it's stating the fact your running Ubuntu's modified GNOME session.

XDG_CURRENT_DESKTOP is supposed to indicate just that: the current desktop environment

Not some insight into whatever technology that desktop is using - other variables like XDG_SESSION_TYPE do that

Really there is 3 approaches here:
  1. Convince every desktop session to export "OPENJDK_HEY_IM_GTK" and look at that. - and then wait 4/5 years for that to trickle down to users
  2. Maintain a map of know names in OpenJDK itself
  3. Assume all Linux based platforms use Gtk

When your trying to choose between Windows, GTK, Aqua, Motif & Metal the best choice would seem to be 3

When KDELookAndFeel becomes a thing you can worry about detecting KDE or LXQt, currently this is a rather academic exercise

Attachment: signature.asc
Description: This is a digitally signed message part



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