i3ipc-rs icon indicating copy to clipboard operation
i3ipc-rs copied to clipboard

Add support for marks to get_tree

Open brownjohnf opened this issue 4 years ago • 2 comments

This change makes the following changes:

  • Add a new feature (i3-4-18-1) to support marks in the nodes returned from get_tree
  • Add an example illustrating how to use the get_tree command
  • Add a marks field to the Node struct, when the i3-4-18-1 feature is enabled
  • Populate the marks field in the Node struct on a call to get_tree, when the i3-4-18-1 feature is enabled
  • Add documentation from the README to lib.rs so it's available in the crate documentation
  • Apply cargo fmt to lib.rs and common.rs
  • Add a test that tests to ensure a mark comes back when calling get_tree with the i3-4-18-1 feature enabled

Questions

  1. The Node struct is constructed for the container when a window event is received; will this container also always have the marks property set coming back from the i3 API?
  2. Same question as above about the workspace event.

I think it should be okay, based on the way the JSON is being parsed. If the marks field is missing, I think it'll just be an empty vec.

brownjohnf avatar Jun 27 '20 23:06 brownjohnf

Assuming I'm right about these changes, this should close #59

brownjohnf avatar Jun 27 '20 23:06 brownjohnf

Also, I'm not sure how you handle versioning, so I didn't touch that in this PR so far.

brownjohnf avatar Jun 28 '20 03:06 brownjohnf