Comment 4 for bug 245057

Revision history for this message
TAC one (tacone) wrote :

From KillerKiwi.

 def get_desktop_enviroment(self):
  # Taken from orignal xdg scripts
  if os.getenv("GNOME_DESKTOP_SESSION_ID") != None and os.getenv("GNOME_DESKTOP_SESSION_ID") != "":
   return "GNOME"
  if os.getenv("KDE_FULL_SESSION") != None and os.getenv("KDE_FULL_SESSION") == "true":
   return "KDE"

  try:
   if Popen(["xprop", "-root", "_DT_SAVE_MODE"], stdout=PIPE, stderr=open(os.devnull, "w")).communicate()[0].strip().lower().count("xfce") > 0:
    return "XFCE"
  except:
   pass

  return "CLI"