XDG_CURRENT_DESKTOP
$XDG_CURRENT_DESKTOP should have been set by the login manager, according to the value of the DesktopNames found in the session file. The entry in the session file has multiple values separated in the usual way: with a semicolon.
今起動しているデスクトップ環境がなにかの判別に使える環境変数。
Both the KDE and GNOME desktop environments have adopted a similar format for "desktop entries", or configuration files describing how a particular program is to be launched, how it appears in menus, etc. It is to the larger community's benefit that a unified standard be agreed upon by all parties such that interoperation between the two environments, and indeed any additional environments that implement the specification, becomes simpler.
とあるので、GNOMEとKDEの判別には使える。他のデスクトップ環境でこれが使えるかはそれぞれ試してみないとわからない。