eric6/Globals/__init__.py

changeset 7253
50dbe65a1334
parent 7229
53054eb5b15a
child 7360
9190402e4505
equal deleted inserted replaced
7252:c5e3705073eb 7253:50dbe65a1334
15 import sys 15 import sys
16 import os 16 import os
17 import re 17 import re
18 import shutil 18 import shutil
19 19
20 from PyQt5.QtCore import QDir, QLibraryInfo, QByteArray, QCoreApplication, \ 20 from PyQt5.QtCore import (
21 QT_VERSION_STR, QT_VERSION, QProcess, qVersion 21 QDir, QLibraryInfo, QByteArray, QCoreApplication, QT_VERSION_STR,
22 QT_VERSION, QProcess, qVersion
23 )
22 24
23 # names of the various settings objects 25 # names of the various settings objects
24 settingsNameOrganization = "Eric6" 26 settingsNameOrganization = "Eric6"
25 settingsNameGlobal = "eric6" 27 settingsNameGlobal = "eric6"
26 settingsNameRecent = "eric6recent" 28 settingsNameRecent = "eric6recent"
112 if not isLinuxPlatform(): 114 if not isLinuxPlatform():
113 return False 115 return False
114 116
115 isKDE = False 117 isKDE = False
116 118
117 desktop = os.environ.get("XDG_CURRENT_DESKTOP", "").lower() or \ 119 desktop = (
118 os.environ.get("XDG_SESSION_DESKTOP", "").lower() or \ 120 os.environ.get("XDG_CURRENT_DESKTOP", "").lower() or
121 os.environ.get("XDG_SESSION_DESKTOP", "").lower() or
119 os.environ.get("DESKTOP_SESSION", "").lower() 122 os.environ.get("DESKTOP_SESSION", "").lower()
123 )
120 if desktop: 124 if desktop:
121 isKDE = "kde" in desktop or "plasma" in desktop 125 isKDE = "kde" in desktop or "plasma" in desktop
122 else: 126 else:
123 isKDE = bool(os.environ.get("KDE_FULL_SESSION", "")) 127 isKDE = bool(os.environ.get("KDE_FULL_SESSION", ""))
124 128
135 if not isLinuxPlatform(): 139 if not isLinuxPlatform():
136 return False 140 return False
137 141
138 isGnome = False 142 isGnome = False
139 143
140 desktop = os.environ.get("XDG_CURRENT_DESKTOP", "").lower() or \ 144 desktop = (
141 os.environ.get("XDG_SESSION_DESKTOP", "").lower() or \ 145 os.environ.get("XDG_CURRENT_DESKTOP", "").lower() or
146 os.environ.get("XDG_SESSION_DESKTOP", "").lower() or
142 os.environ.get("GDMSESSION", "").lower() 147 os.environ.get("GDMSESSION", "").lower()
148 )
143 if desktop: 149 if desktop:
144 isGnome = "gnome" in desktop 150 isGnome = "gnome" in desktop
145 else: 151 else:
146 isGnome = bool(os.environ.get("GNOME_DESKTOP_SESSION_ID", "")) 152 isGnome = bool(os.environ.get("GNOME_DESKTOP_SESSION_ID", ""))
147 153

eric ide

mercurial