def stop(self) -> None:
        """
        Deactivates the inhibitor, removing lock and signal handler
        before closing bus connection.
        """
        if not has_dbus or self.bus is None:
            return

        if self.fd > 0:
            self.release()

        if self.sleep or self.resume:
            self.login.off_prepare_for_sleep(self.prepare_for_sleep)

        self.bus.disconnect()
        self.bus = None

        Deactivates the inhibitor, removing lock and signal handler
        before closing bus connection.
        
libqtile/resources/sleep.py