appmenus: fix detection of desktop environment

In Fedora 23-based dom0, DESKTOP_SESSION environment contains full path
to session file, instead of just basename.

QubesOS/qubes-issues#1606
This commit is contained in:
Marek Marczykowski-Górecki 2016-07-14 04:32:16 +02:00
parent 6cd45f88c5
commit e90c8a97ff
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -319,7 +319,7 @@ def QubesVm_label_setter(self, _):
# Apparently desktop environments heavily caches the icons, # Apparently desktop environments heavily caches the icons,
# see #751 for details # see #751 for details
if os.environ.get("DESKTOP_SESSION", "") == "kde-plasma": if "plasma" in os.environ.get("DESKTOP_SESSION", ""):
try: try:
os.unlink(os.path.expandvars( os.unlink(os.path.expandvars(
"$HOME/.kde/cache-$HOSTNAME/icon-cache.kcache")) "$HOME/.kde/cache-$HOSTNAME/icon-cache.kcache"))
@ -337,7 +337,7 @@ def QubesVm_label_setter(self, _):
dbus_interface="org.freedesktop.Notifications") dbus_interface="org.freedesktop.Notifications")
except: except:
pass pass
elif os.environ.get("DESKTOP_SESSION", "") == "xfce": elif "xfce" in os.environ.get("DESKTOP_SESSION", ""):
self.appmenus_remove() self.appmenus_remove()
self.appmenus_create() self.appmenus_create()