diff -r 67ae52179c8b -r f481df37413c Globals/__init__.py --- a/Globals/__init__.py Sun May 13 14:58:23 2018 +0200 +++ b/Globals/__init__.py Mon May 14 19:40:29 2018 +0200 @@ -43,7 +43,7 @@ @return flag indicating Windows platform (boolean) """ - return sys.platform.startswith("win") + return sys.platform.startswith(("win", "cygwin")) def isMacPlatform(): @@ -64,6 +64,32 @@ return sys.platform.startswith("linux") +def desktopName(): + """ + Function to determine the name of the desktop environment used + (Linux only). + + @return name of the desktop environment + @rtype str + """ + if not isLinuxPlatform(): + return "" + + currDesktop = os.environ.get("XDG_CURRENT_DESKTOP", "") + if currDesktop: + return currDesktop + + currDesktop = os.environ.get("XDG_SESSION_DESKTOP", "") + if currDesktop: + return currDesktop + + currDesktop = os.environ.get("GDMSESSION", "") + if currDesktop: + return currDesktop + + return "" + + def checkBlacklistedVersions(): """ Module functions to check for blacklisted versions of the prerequisites.