mirror of
https://github.com/vincentbernat/i3wm-configuration.git
synced 2025-06-21 17:39:00 +02:00
i3-companion: don't display layout for workspaces unless empty
This commit is contained in:
parent
28688357a1
commit
47d4fc848c
1 changed files with 21 additions and 11 deletions
|
@ -269,12 +269,22 @@ async def workspace_info(i3, event):
|
||||||
if not focused:
|
if not focused:
|
||||||
return
|
return
|
||||||
workspace = focused[0]
|
workspace = focused[0]
|
||||||
summary = f"About workspace {workspace.num} on {workspace.output}"
|
summary = f"Workspace {workspace.num} on {workspace.output}"
|
||||||
tree = await i3.get_tree()
|
tree = await i3.get_tree()
|
||||||
workspace = [w for w in tree.workspaces()
|
workspace = [w for w in tree.workspaces()
|
||||||
if w.num == workspace.num]
|
if w.num == workspace.num]
|
||||||
|
|
||||||
def format(container):
|
def format(container):
|
||||||
|
if container.type == "workspace":
|
||||||
|
if container.nodes:
|
||||||
|
root = ""
|
||||||
|
else:
|
||||||
|
if container.ipc_data['workspace_layout'] != "default":
|
||||||
|
layout = container.ipc_data['workspace_layout']
|
||||||
|
else:
|
||||||
|
layout = container.layout
|
||||||
|
root = f"Empty workspace, with {layout} layout"
|
||||||
|
else:
|
||||||
if container.focused:
|
if container.focused:
|
||||||
style = 'foreground="#ffaf00"'
|
style = 'foreground="#ffaf00"'
|
||||||
else:
|
else:
|
||||||
|
@ -303,7 +313,7 @@ async def workspace_info(i3, event):
|
||||||
"-i", "system-search",
|
"-i", "system-search",
|
||||||
"-t", "15000",
|
"-t", "15000",
|
||||||
summary,
|
summary,
|
||||||
body)
|
body.lstrip("\n"))
|
||||||
|
|
||||||
|
|
||||||
output_update_running = None
|
output_update_running = None
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue