From 84125094b25c2e5c03f2c65b87167f8291aaab5f Mon Sep 17 00:00:00 2001 From: Arpit Chakladar Date: Wed, 26 Aug 2026 17:05:44 +0530 Subject: desktop: added styles for active window buttons - made the active window buttons clickable to navigate to that window --- modules/desktop/eww/activate-windows.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'modules/desktop/eww/activate-windows.py') diff --git a/modules/desktop/eww/activate-windows.py b/modules/desktop/eww/activate-windows.py index b0dba4a..5773d64 100644 --- a/modules/desktop/eww/activate-windows.py +++ b/modules/desktop/eww/activate-windows.py @@ -66,6 +66,17 @@ def emit_active_windows(): active_ws = next((w for w in workspaces if w.get("is_active")), None) active_id = active_ws["id"] if active_ws else None + on_workspace = [w for w in windows if w.get("workspace_id") == active_id] + + def sort_key(w): + pos = (w.get("layout") or {}).get("pos_in_scrolling_layout") + if pos is not None: + return (0, pos[0], pos[1]) + # floating / positionless windows: push to the end, stable by id + return (1, w["id"], 0) + + on_workspace.sort(key=sort_key) + result = [ { "id": w["id"], @@ -74,8 +85,7 @@ def emit_active_windows(): "is_focused": w.get("is_focused", False), "icon": resolve_icon_path(w.get("app_id") or ""), } - for w in windows - if w.get("workspace_id") == active_id + for w in on_workspace ] print(json.dumps(result), flush=True) -- cgit v1.2.3