-
-
Notifications
You must be signed in to change notification settings - Fork 150
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
contrib: add python layout #394
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks pretty neat, could I get a TLDR on how to get pywayland to scan the river-layout protocol so I can test this? Probably would be worth adding that to the comment at the top as well, similar to the build instructions for contrib/layout.c
.
TBH I have no idea how pywaylands scanner is supposed to work. I got it to scan the protocol and generate bindings by copying it to sudo python3 -m pywayland.scanner --with-protocols |
@ifreund I have found out how to make the scanning work. mkdir protocols
python -m pywayland.scanner -o protocols -i /usr/share/wayland/wayland.xml ../protocols/river-layout-v3.xml The scanner finds Now I only need to figure out how to make python import the local bindings. |
Ok, I give up. I don't think pywayland supports using local bindings. It seems like all bindings have to be part of the actual package, which means the only two options I see are either having a local copy of pywayland with the bindings, or adding the bindings to the global pywayland package. The command to add the bindings to the global package: sudo python3 -m pywayland.scanner --with-protocols -i /usr/share/wayland/wayland.xml river-layout-v3.xml That command probably also works for local packages, sans the |
8ba1032
to
946ed36
Compare
I added the instructions for generating the bindings into the layout. They will be automatically printed if importing the river-layout bindings fails. If we don't find python wayland bindings that are nicer to use, this will not get any better than it is now I am afraid. |
946ed36
to
b4047f9
Compare
b4047f9
to
f510e51
Compare
Are there still any blockers, other than pywayland being unwieldy? |
Nope, I just need to find time to deal with setting up pywayland to test. |
This avoids needing to run pwayland's scanner with root privileges and install the river-layout bindings to system directories.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, Thanks!
Note: I found that one can avoid running the pywayland scanner as root by using a virtual environment, which is a lot cleaner. I added a commit recommending this instead. For example:
|
No description provided.