JayceFayne / swayipc-rs

A library for controlling sway through its IPC interface

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No `Workspace::leaves` method

I60R opened this issue · comments

commented

This exists in Python's i3ipc and returns a Vec over windows assigned to workspace

Python's module calculates it and exposes it as method. There is no inbuilt method in i3 protocol to retrieve all the leaves of all workspaces.

commented

Ok

    let mut workspaces: Vec<_> = outputs.as_slice().iter()
        .flat_map(|outputs| outputs.nodes.as_slice())
        .filter(|workspace| workspace.name.as_deref() != Some("__i3_scratch"))
        .collect();

did the job