Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates to Extensions #4750

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

elParaguayo
Copy link
Member

@elParaguayo elParaguayo commented Apr 4, 2024

Draft for now.

This PR makes a few changes to extensions:

  • extensions are now CommandObjects i.e. they can be accessed via qtile's command graph so we can do lazy.extension["extensionname"].run()
  • extensions are run asynchronously which prevents the IPC server from timing out
  • docs are updated to show extensions on the command graph
  • tests are updated

Outstanding:

  • Need to think of best way to have extensions defined in the config.
  • Needs migrations to fix property name clashes

@tych0
Copy link
Member

tych0 commented Apr 5, 2024

Need to think of best way to have extensions defined in the config.

extensions = {
    "foo": FooExtension(...),
}

in the top level config maybe?

@@ -58,54 +59,80 @@ def node_args(self, enabled=True, highlight=False, relative_url=str()):
}


def calc_vertex_position(number_nodes, include_origin=True, radius=2, offset=0, rounding=2):
"""
Generator to calculate x, y coordinates for vertices on a regular polygon.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you make this comment regular inscribed polygon? i had to stare at your math for a while to understand what was happening.

@@ -100,7 +110,7 @@ class RunCommand(_Extension):
# among all the objects inheriting this class, and if one of them
# modified it, all the other objects would see the modified list;
# use a string or a tuple instead, which are immutable
("command", None, "the command to be launched (string or list with arguments)"),
("cmd", None, "the command to be launched (string or list with arguments)"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a motivation for this change?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. CommandObject has a command method so this clashes with that.

@@ -62,24 +62,29 @@ class CommandSet(Dmenu):
"""

defaults = [
("commands", None, "dictionary of commands where key is runable command"),
("commandset", None, "dictionary of commands where key is runable command"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commanddict? but can we just leave this as commands, or is there a technical reason not to?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above, CommandObject also has a commands method.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oof, ok, that's unfortunate. (But still, isn't this a dict?)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes - it's an annoying clash.

And, yes, it's a dict. Will fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants