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"
From KillerKiwi.
def get_desktop_ enviroment( self): "GNOME_ DESKTOP_ SESSION_ ID") != None and os.getenv( "GNOME_ DESKTOP_ SESSION_ ID") != "": "KDE_FULL_ SESSION" ) != None and os.getenv( "KDE_FULL_ SESSION" ) == "true":
# Taken from orignal xdg scripts
if os.getenv(
return "GNOME"
if os.getenv(
return "KDE"
try: open(os. devnull, "w")).communica te()[0] .strip( ).lower( ).count( "xfce") > 0:
if Popen(["xprop", "-root", "_DT_SAVE_MODE"], stdout=PIPE, stderr=
return "XFCE"
except:
pass
return "CLI"