Added window parameters for eww

This commit is contained in:
Ezri Brimhall 2025-02-05 10:54:44 -07:00
parent a760b23685
commit c478a4f7d4
Signed by: ezri
GPG Key ID: 058A78E5680C6F24

View File

@ -101,6 +101,8 @@ class WorkspaceGroup:
self.mode = output_data.get("mode", None) self.mode = output_data.get("mode", None)
self.transform = output_data.get("transform", None) self.transform = output_data.get("transform", None)
self.eww_windows = output_data.get("eww_windows", []) self.eww_windows = output_data.get("eww_windows", [])
if isinstance(self.eww_windows, list):
self.eww_windows = {window: {} for window in self.eww_windows}
self.workspaces = [] self.workspaces = []
def add_workspace(self, workspace: Workspace): def add_workspace(self, workspace: Workspace):
@ -320,12 +322,24 @@ class WorkspaceContext:
await proc.wait() await proc.wait()
for group in self.groups: for group in self.groups:
for window in group.eww_windows: for window in group.eww_windows:
extra_args = [
f"{key}={value}" for key, value in group.eww_windows[window].items()
]
extra_args = list(
zip(
["--arg"] * len(extra_args),
extra_args,
)
)
proc = await asyncio.create_subprocess_exec( proc = await asyncio.create_subprocess_exec(
"eww", "eww",
"open", "open",
window, window,
"--screen", "--screen",
await group.get_output_name(i3), await group.get_output_name(i3),
"--arg",
f"group={group.name}",
*extra_args,
) )
await proc.wait() await proc.wait()