|
|
@ -740,40 +740,38 @@ def _get_linux_desktop_environment(env, logger):
|
|
|
|
xdg_current_desktop = env.get('XDG_CURRENT_DESKTOP', None)
|
|
|
|
xdg_current_desktop = env.get('XDG_CURRENT_DESKTOP', None)
|
|
|
|
desktop_session = env.get('DESKTOP_SESSION', None)
|
|
|
|
desktop_session = env.get('DESKTOP_SESSION', None)
|
|
|
|
if xdg_current_desktop is not None:
|
|
|
|
if xdg_current_desktop is not None:
|
|
|
|
xdg_current_desktop = xdg_current_desktop.split(':')[0].strip()
|
|
|
|
for part in map(str.strip, xdg_current_desktop.split(':')):
|
|
|
|
|
|
|
|
if part == 'Unity':
|
|
|
|
if xdg_current_desktop == 'Unity':
|
|
|
|
if desktop_session is not None and 'gnome-fallback' in desktop_session:
|
|
|
|
if desktop_session is not None and 'gnome-fallback' in desktop_session:
|
|
|
|
return _LinuxDesktopEnvironment.GNOME
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
return _LinuxDesktopEnvironment.UNITY
|
|
|
|
|
|
|
|
elif part == 'Deepin':
|
|
|
|
|
|
|
|
return _LinuxDesktopEnvironment.DEEPIN
|
|
|
|
|
|
|
|
elif part == 'GNOME':
|
|
|
|
return _LinuxDesktopEnvironment.GNOME
|
|
|
|
return _LinuxDesktopEnvironment.GNOME
|
|
|
|
else:
|
|
|
|
elif part == 'X-Cinnamon':
|
|
|
|
return _LinuxDesktopEnvironment.UNITY
|
|
|
|
return _LinuxDesktopEnvironment.CINNAMON
|
|
|
|
elif xdg_current_desktop == 'Deepin':
|
|
|
|
elif part == 'KDE':
|
|
|
|
return _LinuxDesktopEnvironment.DEEPIN
|
|
|
|
kde_version = env.get('KDE_SESSION_VERSION', None)
|
|
|
|
elif xdg_current_desktop == 'GNOME':
|
|
|
|
if kde_version == '5':
|
|
|
|
return _LinuxDesktopEnvironment.GNOME
|
|
|
|
return _LinuxDesktopEnvironment.KDE5
|
|
|
|
elif xdg_current_desktop == 'X-Cinnamon':
|
|
|
|
elif kde_version == '6':
|
|
|
|
return _LinuxDesktopEnvironment.CINNAMON
|
|
|
|
return _LinuxDesktopEnvironment.KDE6
|
|
|
|
elif xdg_current_desktop == 'KDE':
|
|
|
|
elif kde_version == '4':
|
|
|
|
kde_version = env.get('KDE_SESSION_VERSION', None)
|
|
|
|
return _LinuxDesktopEnvironment.KDE4
|
|
|
|
if kde_version == '5':
|
|
|
|
else:
|
|
|
|
return _LinuxDesktopEnvironment.KDE5
|
|
|
|
logger.info(f'unknown KDE version: "{kde_version}". Assuming KDE4')
|
|
|
|
elif kde_version == '6':
|
|
|
|
return _LinuxDesktopEnvironment.KDE4
|
|
|
|
return _LinuxDesktopEnvironment.KDE6
|
|
|
|
elif part == 'Pantheon':
|
|
|
|
elif kde_version == '4':
|
|
|
|
return _LinuxDesktopEnvironment.PANTHEON
|
|
|
|
return _LinuxDesktopEnvironment.KDE4
|
|
|
|
elif part == 'XFCE':
|
|
|
|
else:
|
|
|
|
return _LinuxDesktopEnvironment.XFCE
|
|
|
|
logger.info(f'unknown KDE version: "{kde_version}". Assuming KDE4')
|
|
|
|
elif part == 'UKUI':
|
|
|
|
return _LinuxDesktopEnvironment.KDE4
|
|
|
|
return _LinuxDesktopEnvironment.UKUI
|
|
|
|
elif xdg_current_desktop == 'Pantheon':
|
|
|
|
elif part == 'LXQt':
|
|
|
|
return _LinuxDesktopEnvironment.PANTHEON
|
|
|
|
return _LinuxDesktopEnvironment.LXQT
|
|
|
|
elif xdg_current_desktop == 'XFCE':
|
|
|
|
logger.info(f'XDG_CURRENT_DESKTOP is set to an unknown value: "{xdg_current_desktop}"')
|
|
|
|
return _LinuxDesktopEnvironment.XFCE
|
|
|
|
|
|
|
|
elif xdg_current_desktop == 'UKUI':
|
|
|
|
|
|
|
|
return _LinuxDesktopEnvironment.UKUI
|
|
|
|
|
|
|
|
elif xdg_current_desktop == 'LXQt':
|
|
|
|
|
|
|
|
return _LinuxDesktopEnvironment.LXQT
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
logger.info(f'XDG_CURRENT_DESKTOP is set to an unknown value: "{xdg_current_desktop}"')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
elif desktop_session is not None:
|
|
|
|
elif desktop_session is not None:
|
|
|
|
if desktop_session == 'deepin':
|
|
|
|
if desktop_session == 'deepin':
|
|
|
|