wallpaper: Swap to os.environ.get

This commit is contained in:
Dylan Araps 2017-06-26 14:51:09 +10:00
parent 0bf70c105e
commit 25870f9872

View File

@ -8,19 +8,19 @@ from pywal import util
def get_desktop_env():
"""Identify the current running desktop environment."""
desktop = os.getenv("XDG_CURRENT_DESKTOP")
desktop = os.environ.get("XDG_CURRENT_DESKTOP")
if desktop:
return desktop
desktop = os.getenv("DESKTOP_SESSION")
desktop = os.environ.get("DESKTOP_SESSION")
if desktop:
return desktop
desktop = os.getenv("GNOME_DESKTOP_SESSION_ID")
desktop = os.environ.get("GNOME_DESKTOP_SESSION_ID")
if desktop:
return "GNOME"
desktop = os.getenv("MATE_DESKTOP_SESSION_ID")
desktop = os.environ.get("MATE_DESKTOP_SESSION_ID")
if desktop:
return "MATE"