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

Sway compatibility #98

Closed
trbjo opened this issue Nov 28, 2018 · 15 comments
Closed

Sway compatibility #98

trbjo opened this issue Nov 28, 2018 · 15 comments

Comments

@trbjo
Copy link

trbjo commented Nov 28, 2018

Hi

This looks very promising, as I've been looking for at way to temporarily freeze unfocused clients.

You mention in the lead paragraph that this is a python library to control i3 and Sway. I am quite new to this whole IPC thing (but willing to learn), but I can't seem to find any further documentation on how to convert the i3 scripts to become sway compatible. Is it just me that need to go learn some more Python, or what am I missing here?

@acrisci
Copy link
Member

acrisci commented Nov 28, 2018

What's not working?

@trbjo
Copy link
Author

trbjo commented Nov 29, 2018

The tree layout in Sway is different. Compare https://i3wm.org/docs/ipc.html with https://transfer.sh/FXtjj/tree.json

There is no "window_properties" in Sway. As far as I can see, everything is contained within "nodes"{} in Sway.

That would certainly explain why I could only get the "workspace-new.py" to work.

@acrisci
Copy link
Member

acrisci commented Nov 29, 2018

Oh ok let's fix that then.

@fennerm
Copy link

fennerm commented Jul 28, 2019

@acrisci Any chance 8d3f5d8 will be included into a release soon?

@acrisci
Copy link
Member

acrisci commented Jul 28, 2019

It's kind of a complicated release because I'm adding asyncio and dropping python2 but I should get it out soon. In the meantime, test more sway features. It should be completely compatible.

@fennerm
Copy link

fennerm commented Jul 29, 2019

Awesome thanks for the update. I’ve been testing it and its all running great so far :)

@tmccombs
Copy link

tmccombs commented Jan 5, 2020

Another compatibility issue is that the "visible" property isn't exposed. More generally, I wonder if there should be some way to access fields that aren't explicitly handled by i3ipc. Either by setting attributes for any properties that i3ipc doesn't know about, or keeping the original data, so it is accessible if needed.

(See also swaywm/sway#4879, which adds documentation for a few properties that i3ipc doesn't handle)

@tmccombs
Copy link

tmccombs commented Jan 5, 2020

Also, at least in sway, outputs additional information on them (for example "current_workspace", "current_mode", etc.)

@acrisci
Copy link
Member

acrisci commented Jan 5, 2020

Another compatibility issue is that the "visible" property isn't exposed.

Also, at least in sway, outputs additional information on them (for example "current_workspace", "current_mode", etc.)

It's easy to add properties.

More generally, I wonder if there should be some way to access fields that aren't explicitly handled by i3ipc.

Yeah it would probably be a good idea to store the "raw_properties" in a dict for access of anything I'm missing.

@maximbaz
Copy link

It also seems that scratchpad is not supported on sway, Connection().get_tree().scratchpad() returns None.

@acrisci
Copy link
Member

acrisci commented Jan 26, 2020

They probably put the scratchpad container in a different place in the tree.

@tmccombs
Copy link

The scratchpad is definitely in the tree output, so it probably is just in a different place.

@acrisci
Copy link
Member

acrisci commented Mar 7, 2020

I just added an ipc_data member to the types that gives you the raw json for forwards compatibility with sway members.

@acrisci
Copy link
Member

acrisci commented Mar 22, 2020

I added all the properties that are known to me at this time. The only thing left is to fix the scratchpad.

@acrisci
Copy link
Member

acrisci commented Mar 22, 2020

I believe I'm completely sway compatible right now. Thanks for the input and open separate issues for anything else. I'll release in a few days, so go ahead and test.

@acrisci acrisci closed this as completed Mar 22, 2020
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

No branches or pull requests

5 participants