summaryrefslogtreecommitdiff
path: root/portato/helper.py
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2009-03-19 21:10:37 +0100
committerRené 'Necoro' Neumann <necoro@necoro.net>2009-03-19 21:10:37 +0100
commitabde20daebee82abb754835d6f7c309f7aea3819 (patch)
tree0e9f36dec4c9656df67b373713b4a30a7e1c2f36 /portato/helper.py
parent79586b7b6a02d0f88246574c943f9a01f4dd89b6 (diff)
downloadportato-abde20daebee82abb754835d6f7c309f7aea3819.tar.gz
portato-abde20daebee82abb754835d6f7c309f7aea3819.tar.bz2
portato-abde20daebee82abb754835d6f7c309f7aea3819.zip
Add support for ktsuss as su frontend
Diffstat (limited to '')
-rw-r--r--portato/helper.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/portato/helper.py b/portato/helper.py
index d3fc70b..5b275d6 100644
--- a/portato/helper.py
+++ b/portato/helper.py
@@ -151,3 +151,22 @@ def unique_array(s):
if x not in u:
u.append(x)
return u
+
+def detect_desktop_environment():
+ # stolen from wicd :)
+
+ desktop_environment = 'generic'
+ if os.environ.get('KDE_FULL_SESSION') == 'true':
+ desktop_environment = 'kde'
+ elif os.environ.get('GNOME_DESKTOP_SESSION_ID'):
+ desktop_environment = 'gnome'
+ #else: # no need for this part as of now
+ # try:
+ # info = commands.getoutput('xprop -root _DT_SAVE_MODE')
+ # if ' = "xfce4"' in info:
+ # desktop_environment = 'xfce'
+ # except (OSError, RuntimeError):
+ # pass
+
+ return desktop_environment
+