feat: dim other monitors workspaces

This commit is contained in:
2026-05-03 19:05:46 +02:00
parent aee5be7f39
commit fb206667c4
3 changed files with 20 additions and 0 deletions

View File

@@ -61,6 +61,9 @@ class FensterWorkspaceButton(Button):
def set_urgent(self, urgent: bool):
self._toggle_class("urgent", urgent)
def set_foreign(self, foreign: bool):
self._toggle_class("foreign", foreign)
class FensterWorkspaces(Box):
"""Container widget showing a fixed set of workspace bubbles (1..N)."""
@@ -149,11 +152,13 @@ class FensterWorkspaces(Box):
button.set_visible_other(False)
button.set_urgent(False)
button.set_empty(True)
button.set_foreign(False)
continue
focused = bool(ws.get("focused"))
visible = bool(ws.get("visible"))
urgent = bool(ws.get("urgent"))
ws_output = ws.get("output")
window_count = ws.get("window_count", 0)
button.set_active(focused)
@@ -161,6 +166,12 @@ class FensterWorkspaces(Box):
button.set_visible_other(visible and not focused)
button.set_urgent(urgent)
button.set_empty(window_count == 0)
# Workspace currently shown on a different output than this bar's.
button.set_foreign(
self._output is not None
and ws_output is not None
and ws_output != self._output
)
self.show_all()