hyprland-community / pyprland

Scratchpads & many goodies for Hyprland [maintainer=@fdev31]
MIT License
390 stars 17 forks source link

[BUG] expose throws an error #80

Closed Sombrer0Dev closed 6 months ago

Sombrer0Dev commented 6 months ago

Pyprland version 2.2.6-3

Describe the bug expose plugin throws an AttributeError:

Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/pyprland/command.py", line 191, in _run_plugin_handler
    await getattr(plugin, full_name)(*params)
  File "/usr/lib/python3.11/site-packages/pyprland/plugins/expose.py", line 32, in run_expose
    commands.extend(
    ^^^^^^^^^^^^^^^
AttributeError: 'coroutine' object has no attribute 'extend'

To Reproduce Steps to reproduce the behavior:

  1. Use pypr expose command

Expected behavior Behavior like in expose demo

Configuration (provide following files/samples when relevant):
Pyprland:

Hyprland:

fdev31 commented 6 months ago

Oh sorry, I broke it with a recent change, I'll update it soon but in the meantime if you don't want to be bothered, just remove the "async" in move_clients_to_workspace:

diff --git a/pyprland/plugins/expose.py b/pyprland/plugins/expose.py
index 94f8af3..79b976f 100644
--- a/pyprland/plugins/expose.py
+++ b/pyprland/plugins/expose.py
@@ -15,7 +15,7 @@ class Extension(CastBoolMixin, Plugin):  # pylint: disable=missing-class-docstri
             return self.exposed_clients_list
         return [c for c in self.exposed_clients_list if c["workspace"]["id"] > 0]

-    async def move_clients_to_workspace(self, workspace, clients):
+    def move_clients_to_workspace(self, workspace, clients):
         """Move clients to a workspace"""
         return [
             f"movetoworkspacesilent {workspace},address:{client['address']}"
fdev31 commented 6 months ago

It was more complex than this, I tested copilot recently and didn't review the code carefully enough, it was completely broken. I pushed a new release reverting the "optimizations" of the expose plugin. Re-open if I missed something and thank you again for the quick report!