async def _start(self) -> None:
        """
        Creates the bus connection and connects to the org.freedesktop.login1.Manager
        interface. Starts an inhibitor if we are listening for sleep events.
        Attaches handler to the "PrepareForSleep" signal.
        """
        # Connect to bus and Manager interface
        try:
            self.bus = await MessageBus(bus_type=BusType.SYSTEM, negotiate_unix_fd=True).connect()
        except FileNotFoundError:
            self.bus = None
            logger.warning(
                "Could not find logind service. Suspend and resume hooks will be unavailable."
            )
            return

        try:
            introspection = await self.bus.introspect(LOGIND_SERVICE, LOGIND_PATH)
        except DBusError:
            logger.warning(
                "Could not find logind service. Suspend and resume hooks will be unavailable."
            )
            self.bus.disconnect()
            self.bus = None
            return

        obj = self.bus.get_proxy_object(LOGIND_SERVICE, LOGIND_PATH, introspection)
        self.login = obj.get_interface(LOGIND_INTERFACE)

        # If we want to know when the system is sleeping when we request an inhibitor
        if self.sleep:
            self.take()

        # Finally, attach a handler for the "PrepareForSleep" signal
        self.login.on_prepare_for_sleep(self.prepare_for_sleep)

        Creates the bus connection and connects to the org.freedesktop.login1.Manager
        interface. Starts an inhibitor if we are listening for sleep events.
        Attaches handler to the "PrepareForSleep" signal.
        
libqtile/resources/sleep.py