We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Lutris won't start
**I tried to open Lutris, after downloading it using the instructions from the website**

**Expected behavior**

I was hoping for it to open.

**Current behavior**

It will not open. 

**Lutris debugging output**
When I went to check it out in the terminal, this was the result:
Traceback (most recent call last):
  File "/usr/games/lutris", line 40, in <module>
    from lutris.gui.application import Application
  File "/usr/lib/python3/dist-packages/lutris/gui/application.py", line 35, in <module>
    from lutris.game import Game
  File "/usr/lib/python3/dist-packages/lutris/game.py", line 14, in <module>
    from lutris.runners import import_runner, InvalidRunner, wine
  File "/usr/lib/python3/dist-packages/lutris/runners/wine.py", line 11, in <module>
    from lutris.runners.runner import Runner
  File "/usr/lib/python3/dist-packages/lutris/runners/runner.py", line 7, in <module>
    from lutris.config import LutrisConfig
  File "/usr/lib/python3/dist-packages/lutris/config.py", line 6, in <module>
    from lutris import settings, sysoptions
  File "/usr/lib/python3/dist-packages/lutris/sysoptions.py", line 9, in <module>
    from lutris.util.display import USE_DRI_PRIME, DISPLAY_MANAGER
  File "/usr/lib/python3/dist-packages/lutris/util/display.py", line 4, in <module>
    from dbus.exceptions import DBusException
ModuleNotFoundError: No module named 'dbus'`.





--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `lutris/util/display.py`
Content:
```
1 """Module to deal with various aspects of displays"""
2 # Standard Library
3 import os
4 import subprocess
5 
6 # Third Party Libraries
7 from dbus.exceptions import DBusException
8 from gi.repository import Gdk, GLib, GnomeDesktop
9 
10 # Lutris Modules
11 from lutris.util import system
12 from lutris.util.graphics.displayconfig import MutterDisplayManager
13 from lutris.util.graphics.xrandr import LegacyDisplayManager, change_resolution, get_outputs
14 from lutris.util.log import logger
15 
16 
17 class NoScreenDetected(Exception):
18 
19     """Raise this when unable to detect screens"""
20 
21 
22 def restore_gamma():
23     """Restores gamma to a normal level."""
24     xgamma_path = system.find_executable("xgamma")
25     try:
26         subprocess.Popen([xgamma_path, "-gamma", "1.0"])
27     except (FileNotFoundError, TypeError):
28         logger.warning("xgamma is not available on your system")
29     except PermissionError:
30         logger.warning("you do not have permission to call xgamma")
31 
32 
33 def _get_graphics_adapters():
34     """Return the list of graphics cards available on a system
35 
36     Returns:
37         list: list of tuples containing PCI ID and description of the display controller
38     """
39     lspci_path = system.find_executable("lspci")
40     dev_subclasses = ["VGA", "XGA", "3D controller", "Display controller"]
41     if not lspci_path:
42         logger.warning("lspci is not available. List of graphics cards not available")
43         return []
44     return [
45         (pci_id, device_desc.split(": ")[1]) for pci_id, device_desc in [
46             line.split(maxsplit=1) for line in system.execute(lspci_path).split("\n")
47             if any(subclass in line for subclass in dev_subclasses)
48         ]
49     ]
50 
51 
52 class DisplayManager:
53 
54     """Get display and resolution using GnomeDesktop"""
55 
56     def __init__(self):
57         screen = Gdk.Screen.get_default()
58         if not screen:
59             raise NoScreenDetected
60         self.rr_screen = GnomeDesktop.RRScreen.new(screen)
61         self.rr_config = GnomeDesktop.RRConfig.new_current(self.rr_screen)
62         self.rr_config.load_current()
63 
64     def get_display_names(self):
65         """Return names of connected displays"""
66         return [output_info.get_display_name() for output_info in self.rr_config.get_outputs()]
67 
68     def get_resolutions(self):
69         """Return available resolutions"""
70         resolutions = ["%sx%s" % (mode.get_width(), mode.get_height()) for mode in self.rr_screen.list_modes()]
71         return sorted(set(resolutions), key=lambda x: int(x.split("x")[0]), reverse=True)
72 
73     def _get_primary_output(self):
74         """Return the RROutput used as a primary display"""
75         for output in self.rr_screen.list_outputs():
76             if output.get_is_primary():
77                 return output
78         return
79 
80     def get_current_resolution(self):
81         """Return the current resolution for the primary display"""
82         output = self._get_primary_output()
83         if not output:
84             logger.error("Failed to get a default output")
85             return "", ""
86         current_mode = output.get_current_mode()
87         return str(current_mode.get_width()), str(current_mode.get_height())
88 
89     @staticmethod
90     def set_resolution(resolution):
91         """Set the resolution of one or more displays.
92         The resolution can either be a string, which will be applied to the
93         primary display or a list of configurations as returned by `get_config`.
94         This method uses XrandR and will not work on Wayland.
95         """
96         return change_resolution(resolution)
97 
98     @staticmethod
99     def get_config():
100         """Return the current display resolution
101         This method uses XrandR and will not work on wayland
102         The output can be fed in `set_resolution`
103         """
104         return get_outputs()
105 
106 
107 def get_display_manager():
108     """Return the appropriate display manager instance.
109     Defaults to Mutter if available. This is the only one to support Wayland.
110     """
111     try:
112         return MutterDisplayManager()
113     except DBusException as ex:
114         logger.debug("Mutter DBus service not reachable: %s", ex)
115     except Exception as ex:  # pylint: disable=broad-except
116         logger.exception("Failed to instanciate MutterDisplayConfig. Please report with exception: %s", ex)
117     try:
118         return DisplayManager()
119     except (GLib.Error, NoScreenDetected):
120         return LegacyDisplayManager()
121 
122 
123 DISPLAY_MANAGER = get_display_manager()
124 USE_DRI_PRIME = len(_get_graphics_adapters()) > 1
125 
126 
127 def get_compositor_commands():
128     """Nominated for the worst function in lutris"""
129     start_compositor = None
130     stop_compositor = None
131     desktop_session = os.environ.get("DESKTOP_SESSION")
132     if desktop_session.endswith("plasma"):
133         stop_compositor = ("qdbus org.kde.KWin /Compositor org.kde.kwin.Compositing.suspend")
134         start_compositor = ("qdbus org.kde.KWin /Compositor org.kde.kwin.Compositing.resume")
135     elif (
136         desktop_session.endswith("mate")
137         and system.execute("gsettings get org.mate.Marco.general compositing-manager", shell=True) == "true"
138     ):
139         stop_compositor = ("gsettings set org.mate.Marco.general compositing-manager false")
140         start_compositor = ("gsettings set org.mate.Marco.general compositing-manager true")
141     elif (
142         desktop_session.endswith("xfce") and system.execute(
143             "xfconf-query --channel=xfwm4 --property=/general/use_compositing",
144             shell=True,
145         ) == "true"
146     ):
147         stop_compositor = ("xfconf-query --channel=xfwm4 --property=/general/use_compositing --set=false")
148         start_compositor = ("xfconf-query --channel=xfwm4 --property=/general/use_compositing --set=true")
149     elif (
150         desktop_session.endswith("deepin") and system.execute(
151             "dbus-send --session --dest=com.deepin.WMSwitcher --type=method_call "
152             "--print-reply=literal /com/deepin/WMSwitcher com.deepin.WMSwitcher.CurrentWM",
153             shell=True,
154         ) == "deepin wm"
155     ):
156         start_compositor, stop_compositor = (
157             "dbus-send --session --dest=com.deepin.WMSwitcher --type=method_call "
158             "/com/deepin/WMSwitcher com.deepin.WMSwitcher.RequestSwitchWM",
159         ) * 2
160     return start_compositor, stop_compositor
161
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/lutris/util/display.py b/lutris/util/display.py
--- a/lutris/util/display.py
+++ b/lutris/util/display.py
@@ -1,13 +1,16 @@
 """Module to deal with various aspects of displays"""
-# Standard Library
+# isort:skip_file
 import os
 import subprocess
 
-# Third Party Libraries
-from dbus.exceptions import DBusException
+try:
+    from dbus.exceptions import DBusException
+    DBUS_AVAILABLE = True
+except ImportError:
+    DBUS_AVAILABLE = False
+
 from gi.repository import Gdk, GLib, GnomeDesktop
 
-# Lutris Modules
 from lutris.util import system
 from lutris.util.graphics.displayconfig import MutterDisplayManager
 from lutris.util.graphics.xrandr import LegacyDisplayManager, change_resolution, get_outputs
@@ -108,12 +111,15 @@
     """Return the appropriate display manager instance.
     Defaults to Mutter if available. This is the only one to support Wayland.
     """
-    try:
-        return MutterDisplayManager()
-    except DBusException as ex:
-        logger.debug("Mutter DBus service not reachable: %s", ex)
-    except Exception as ex:  # pylint: disable=broad-except
-        logger.exception("Failed to instanciate MutterDisplayConfig. Please report with exception: %s", ex)
+    if DBUS_AVAILABLE:
+        try:
+            return MutterDisplayManager()
+        except DBusException as ex:
+            logger.debug("Mutter DBus service not reachable: %s", ex)
+        except Exception as ex:  # pylint: disable=broad-except
+            logger.exception("Failed to instanciate MutterDisplayConfig. Please report with exception: %s", ex)
+    else:
+        logger.error("DBus is not available, lutris was not properly installed.")
     try:
         return DisplayManager()
     except (GLib.Error, NoScreenDetected):

{"golden_diff": "diff --git a/lutris/util/display.py b/lutris/util/display.py\n--- a/lutris/util/display.py\n+++ b/lutris/util/display.py\n@@ -1,13 +1,16 @@\n \"\"\"Module to deal with various aspects of displays\"\"\"\n-# Standard Library\n+# isort:skip_file\n import os\n import subprocess\n \n-# Third Party Libraries\n-from dbus.exceptions import DBusException\n+try:\n+    from dbus.exceptions import DBusException\n+    DBUS_AVAILABLE = True\n+except ImportError:\n+    DBUS_AVAILABLE = False\n+\n from gi.repository import Gdk, GLib, GnomeDesktop\n \n-# Lutris Modules\n from lutris.util import system\n from lutris.util.graphics.displayconfig import MutterDisplayManager\n from lutris.util.graphics.xrandr import LegacyDisplayManager, change_resolution, get_outputs\n@@ -108,12 +111,15 @@\n     \"\"\"Return the appropriate display manager instance.\n     Defaults to Mutter if available. This is the only one to support Wayland.\n     \"\"\"\n-    try:\n-        return MutterDisplayManager()\n-    except DBusException as ex:\n-        logger.debug(\"Mutter DBus service not reachable: %s\", ex)\n-    except Exception as ex:  # pylint: disable=broad-except\n-        logger.exception(\"Failed to instanciate MutterDisplayConfig. Please report with exception: %s\", ex)\n+    if DBUS_AVAILABLE:\n+        try:\n+            return MutterDisplayManager()\n+        except DBusException as ex:\n+            logger.debug(\"Mutter DBus service not reachable: %s\", ex)\n+        except Exception as ex:  # pylint: disable=broad-except\n+            logger.exception(\"Failed to instanciate MutterDisplayConfig. Please report with exception: %s\", ex)\n+    else:\n+        logger.error(\"DBus is not available, lutris was not properly installed.\")\n     try:\n         return DisplayManager()\n     except (GLib.Error, NoScreenDetected):\n", "issue": "Lutris won't start\n**I tried to open Lutris, after downloading it using the instructions from the website**\r\n\r\n**Expected behavior**\r\n\r\nI was hoping for it to open.\r\n\r\n**Current behavior**\r\n\r\nIt will not open. \r\n\r\n**Lutris debugging output**\r\nWhen I went to check it out in the terminal, this was the result:\r\nTraceback (most recent call last):\r\n  File \"/usr/games/lutris\", line 40, in <module>\r\n    from lutris.gui.application import Application\r\n  File \"/usr/lib/python3/dist-packages/lutris/gui/application.py\", line 35, in <module>\r\n    from lutris.game import Game\r\n  File \"/usr/lib/python3/dist-packages/lutris/game.py\", line 14, in <module>\r\n    from lutris.runners import import_runner, InvalidRunner, wine\r\n  File \"/usr/lib/python3/dist-packages/lutris/runners/wine.py\", line 11, in <module>\r\n    from lutris.runners.runner import Runner\r\n  File \"/usr/lib/python3/dist-packages/lutris/runners/runner.py\", line 7, in <module>\r\n    from lutris.config import LutrisConfig\r\n  File \"/usr/lib/python3/dist-packages/lutris/config.py\", line 6, in <module>\r\n    from lutris import settings, sysoptions\r\n  File \"/usr/lib/python3/dist-packages/lutris/sysoptions.py\", line 9, in <module>\r\n    from lutris.util.display import USE_DRI_PRIME, DISPLAY_MANAGER\r\n  File \"/usr/lib/python3/dist-packages/lutris/util/display.py\", line 4, in <module>\r\n    from dbus.exceptions import DBusException\r\nModuleNotFoundError: No module named 'dbus'`.\r\n\r\n\r\n\r\n\n", "before_files": [{"content": "\"\"\"Module to deal with various aspects of displays\"\"\"\n# Standard Library\nimport os\nimport subprocess\n\n# Third Party Libraries\nfrom dbus.exceptions import DBusException\nfrom gi.repository import Gdk, GLib, GnomeDesktop\n\n# Lutris Modules\nfrom lutris.util import system\nfrom lutris.util.graphics.displayconfig import MutterDisplayManager\nfrom lutris.util.graphics.xrandr import LegacyDisplayManager, change_resolution, get_outputs\nfrom lutris.util.log import logger\n\n\nclass NoScreenDetected(Exception):\n\n    \"\"\"Raise this when unable to detect screens\"\"\"\n\n\ndef restore_gamma():\n    \"\"\"Restores gamma to a normal level.\"\"\"\n    xgamma_path = system.find_executable(\"xgamma\")\n    try:\n        subprocess.Popen([xgamma_path, \"-gamma\", \"1.0\"])\n    except (FileNotFoundError, TypeError):\n        logger.warning(\"xgamma is not available on your system\")\n    except PermissionError:\n        logger.warning(\"you do not have permission to call xgamma\")\n\n\ndef _get_graphics_adapters():\n    \"\"\"Return the list of graphics cards available on a system\n\n    Returns:\n        list: list of tuples containing PCI ID and description of the display controller\n    \"\"\"\n    lspci_path = system.find_executable(\"lspci\")\n    dev_subclasses = [\"VGA\", \"XGA\", \"3D controller\", \"Display controller\"]\n    if not lspci_path:\n        logger.warning(\"lspci is not available. List of graphics cards not available\")\n        return []\n    return [\n        (pci_id, device_desc.split(\": \")[1]) for pci_id, device_desc in [\n            line.split(maxsplit=1) for line in system.execute(lspci_path).split(\"\\n\")\n            if any(subclass in line for subclass in dev_subclasses)\n        ]\n    ]\n\n\nclass DisplayManager:\n\n    \"\"\"Get display and resolution using GnomeDesktop\"\"\"\n\n    def __init__(self):\n        screen = Gdk.Screen.get_default()\n        if not screen:\n            raise NoScreenDetected\n        self.rr_screen = GnomeDesktop.RRScreen.new(screen)\n        self.rr_config = GnomeDesktop.RRConfig.new_current(self.rr_screen)\n        self.rr_config.load_current()\n\n    def get_display_names(self):\n        \"\"\"Return names of connected displays\"\"\"\n        return [output_info.get_display_name() for output_info in self.rr_config.get_outputs()]\n\n    def get_resolutions(self):\n        \"\"\"Return available resolutions\"\"\"\n        resolutions = [\"%sx%s\" % (mode.get_width(), mode.get_height()) for mode in self.rr_screen.list_modes()]\n        return sorted(set(resolutions), key=lambda x: int(x.split(\"x\")[0]), reverse=True)\n\n    def _get_primary_output(self):\n        \"\"\"Return the RROutput used as a primary display\"\"\"\n        for output in self.rr_screen.list_outputs():\n            if output.get_is_primary():\n                return output\n        return\n\n    def get_current_resolution(self):\n        \"\"\"Return the current resolution for the primary display\"\"\"\n        output = self._get_primary_output()\n        if not output:\n            logger.error(\"Failed to get a default output\")\n            return \"\", \"\"\n        current_mode = output.get_current_mode()\n        return str(current_mode.get_width()), str(current_mode.get_height())\n\n    @staticmethod\n    def set_resolution(resolution):\n        \"\"\"Set the resolution of one or more displays.\n        The resolution can either be a string, which will be applied to the\n        primary display or a list of configurations as returned by `get_config`.\n        This method uses XrandR and will not work on Wayland.\n        \"\"\"\n        return change_resolution(resolution)\n\n    @staticmethod\n    def get_config():\n        \"\"\"Return the current display resolution\n        This method uses XrandR and will not work on wayland\n        The output can be fed in `set_resolution`\n        \"\"\"\n        return get_outputs()\n\n\ndef get_display_manager():\n    \"\"\"Return the appropriate display manager instance.\n    Defaults to Mutter if available. This is the only one to support Wayland.\n    \"\"\"\n    try:\n        return MutterDisplayManager()\n    except DBusException as ex:\n        logger.debug(\"Mutter DBus service not reachable: %s\", ex)\n    except Exception as ex:  # pylint: disable=broad-except\n        logger.exception(\"Failed to instanciate MutterDisplayConfig. Please report with exception: %s\", ex)\n    try:\n        return DisplayManager()\n    except (GLib.Error, NoScreenDetected):\n        return LegacyDisplayManager()\n\n\nDISPLAY_MANAGER = get_display_manager()\nUSE_DRI_PRIME = len(_get_graphics_adapters()) > 1\n\n\ndef get_compositor_commands():\n    \"\"\"Nominated for the worst function in lutris\"\"\"\n    start_compositor = None\n    stop_compositor = None\n    desktop_session = os.environ.get(\"DESKTOP_SESSION\")\n    if desktop_session.endswith(\"plasma\"):\n        stop_compositor = (\"qdbus org.kde.KWin /Compositor org.kde.kwin.Compositing.suspend\")\n        start_compositor = (\"qdbus org.kde.KWin /Compositor org.kde.kwin.Compositing.resume\")\n    elif (\n        desktop_session.endswith(\"mate\")\n        and system.execute(\"gsettings get org.mate.Marco.general compositing-manager\", shell=True) == \"true\"\n    ):\n        stop_compositor = (\"gsettings set org.mate.Marco.general compositing-manager false\")\n        start_compositor = (\"gsettings set org.mate.Marco.general compositing-manager true\")\n    elif (\n        desktop_session.endswith(\"xfce\") and system.execute(\n            \"xfconf-query --channel=xfwm4 --property=/general/use_compositing\",\n            shell=True,\n        ) == \"true\"\n    ):\n        stop_compositor = (\"xfconf-query --channel=xfwm4 --property=/general/use_compositing --set=false\")\n        start_compositor = (\"xfconf-query --channel=xfwm4 --property=/general/use_compositing --set=true\")\n    elif (\n        desktop_session.endswith(\"deepin\") and system.execute(\n            \"dbus-send --session --dest=com.deepin.WMSwitcher --type=method_call \"\n            \"--print-reply=literal /com/deepin/WMSwitcher com.deepin.WMSwitcher.CurrentWM\",\n            shell=True,\n        ) == \"deepin wm\"\n    ):\n        start_compositor, stop_compositor = (\n            \"dbus-send --session --dest=com.deepin.WMSwitcher --type=method_call \"\n            \"/com/deepin/WMSwitcher com.deepin.WMSwitcher.RequestSwitchWM\",\n        ) * 2\n    return start_compositor, stop_compositor\n", "path": "lutris/util/display.py"}], "after_files": [{"content": "\"\"\"Module to deal with various aspects of displays\"\"\"\n# isort:skip_file\nimport os\nimport subprocess\n\ntry:\n    from dbus.exceptions import DBusException\n    DBUS_AVAILABLE = True\nexcept ImportError:\n    DBUS_AVAILABLE = False\n\nfrom gi.repository import Gdk, GLib, GnomeDesktop\n\nfrom lutris.util import system\nfrom lutris.util.graphics.displayconfig import MutterDisplayManager\nfrom lutris.util.graphics.xrandr import LegacyDisplayManager, change_resolution, get_outputs\nfrom lutris.util.log import logger\n\n\nclass NoScreenDetected(Exception):\n\n    \"\"\"Raise this when unable to detect screens\"\"\"\n\n\ndef restore_gamma():\n    \"\"\"Restores gamma to a normal level.\"\"\"\n    xgamma_path = system.find_executable(\"xgamma\")\n    try:\n        subprocess.Popen([xgamma_path, \"-gamma\", \"1.0\"])\n    except (FileNotFoundError, TypeError):\n        logger.warning(\"xgamma is not available on your system\")\n    except PermissionError:\n        logger.warning(\"you do not have permission to call xgamma\")\n\n\ndef _get_graphics_adapters():\n    \"\"\"Return the list of graphics cards available on a system\n\n    Returns:\n        list: list of tuples containing PCI ID and description of the display controller\n    \"\"\"\n    lspci_path = system.find_executable(\"lspci\")\n    dev_subclasses = [\"VGA\", \"XGA\", \"3D controller\", \"Display controller\"]\n    if not lspci_path:\n        logger.warning(\"lspci is not available. List of graphics cards not available\")\n        return []\n    return [\n        (pci_id, device_desc.split(\": \")[1]) for pci_id, device_desc in [\n            line.split(maxsplit=1) for line in system.execute(lspci_path).split(\"\\n\")\n            if any(subclass in line for subclass in dev_subclasses)\n        ]\n    ]\n\n\nclass DisplayManager:\n\n    \"\"\"Get display and resolution using GnomeDesktop\"\"\"\n\n    def __init__(self):\n        screen = Gdk.Screen.get_default()\n        if not screen:\n            raise NoScreenDetected\n        self.rr_screen = GnomeDesktop.RRScreen.new(screen)\n        self.rr_config = GnomeDesktop.RRConfig.new_current(self.rr_screen)\n        self.rr_config.load_current()\n\n    def get_display_names(self):\n        \"\"\"Return names of connected displays\"\"\"\n        return [output_info.get_display_name() for output_info in self.rr_config.get_outputs()]\n\n    def get_resolutions(self):\n        \"\"\"Return available resolutions\"\"\"\n        resolutions = [\"%sx%s\" % (mode.get_width(), mode.get_height()) for mode in self.rr_screen.list_modes()]\n        return sorted(set(resolutions), key=lambda x: int(x.split(\"x\")[0]), reverse=True)\n\n    def _get_primary_output(self):\n        \"\"\"Return the RROutput used as a primary display\"\"\"\n        for output in self.rr_screen.list_outputs():\n            if output.get_is_primary():\n                return output\n        return\n\n    def get_current_resolution(self):\n        \"\"\"Return the current resolution for the primary display\"\"\"\n        output = self._get_primary_output()\n        if not output:\n            logger.error(\"Failed to get a default output\")\n            return \"\", \"\"\n        current_mode = output.get_current_mode()\n        return str(current_mode.get_width()), str(current_mode.get_height())\n\n    @staticmethod\n    def set_resolution(resolution):\n        \"\"\"Set the resolution of one or more displays.\n        The resolution can either be a string, which will be applied to the\n        primary display or a list of configurations as returned by `get_config`.\n        This method uses XrandR and will not work on Wayland.\n        \"\"\"\n        return change_resolution(resolution)\n\n    @staticmethod\n    def get_config():\n        \"\"\"Return the current display resolution\n        This method uses XrandR and will not work on wayland\n        The output can be fed in `set_resolution`\n        \"\"\"\n        return get_outputs()\n\n\ndef get_display_manager():\n    \"\"\"Return the appropriate display manager instance.\n    Defaults to Mutter if available. This is the only one to support Wayland.\n    \"\"\"\n    if DBUS_AVAILABLE:\n        try:\n            return MutterDisplayManager()\n        except DBusException as ex:\n            logger.debug(\"Mutter DBus service not reachable: %s\", ex)\n        except Exception as ex:  # pylint: disable=broad-except\n            logger.exception(\"Failed to instanciate MutterDisplayConfig. Please report with exception: %s\", ex)\n    else:\n        logger.error(\"DBus is not available, lutris was not properly installed.\")\n    try:\n        return DisplayManager()\n    except (GLib.Error, NoScreenDetected):\n        return LegacyDisplayManager()\n\n\nDISPLAY_MANAGER = get_display_manager()\nUSE_DRI_PRIME = len(_get_graphics_adapters()) > 1\n\n\ndef get_compositor_commands():\n    \"\"\"Nominated for the worst function in lutris\"\"\"\n    start_compositor = None\n    stop_compositor = None\n    desktop_session = os.environ.get(\"DESKTOP_SESSION\")\n    if desktop_session.endswith(\"plasma\"):\n        stop_compositor = (\"qdbus org.kde.KWin /Compositor org.kde.kwin.Compositing.suspend\")\n        start_compositor = (\"qdbus org.kde.KWin /Compositor org.kde.kwin.Compositing.resume\")\n    elif (\n        desktop_session.endswith(\"mate\")\n        and system.execute(\"gsettings get org.mate.Marco.general compositing-manager\", shell=True) == \"true\"\n    ):\n        stop_compositor = (\"gsettings set org.mate.Marco.general compositing-manager false\")\n        start_compositor = (\"gsettings set org.mate.Marco.general compositing-manager true\")\n    elif (\n        desktop_session.endswith(\"xfce\") and system.execute(\n            \"xfconf-query --channel=xfwm4 --property=/general/use_compositing\",\n            shell=True,\n        ) == \"true\"\n    ):\n        stop_compositor = (\"xfconf-query --channel=xfwm4 --property=/general/use_compositing --set=false\")\n        start_compositor = (\"xfconf-query --channel=xfwm4 --property=/general/use_compositing --set=true\")\n    elif (\n        desktop_session.endswith(\"deepin\") and system.execute(\n            \"dbus-send --session --dest=com.deepin.WMSwitcher --type=method_call \"\n            \"--print-reply=literal /com/deepin/WMSwitcher com.deepin.WMSwitcher.CurrentWM\",\n            shell=True,\n        ) == \"deepin wm\"\n    ):\n        start_compositor, stop_compositor = (\n            \"dbus-send --session --dest=com.deepin.WMSwitcher --type=method_call \"\n            \"/com/deepin/WMSwitcher com.deepin.WMSwitcher.RequestSwitchWM\",\n        ) * 2\n    return start_compositor, stop_compositor\n", "path": "lutris/util/display.py"}]}