aboutsummaryrefslogtreecommitdiffstats
path: root/modules/desktop/eww/activate-windows.py
diff options
context:
space:
mode:
authorArpit Chakladar <arpitchakladar+git@gmail.com>2026-08-26 17:05:44 +0530
committerArpit Chakladar <arpitchakladar+git@gmail.com>2026-08-29 03:50:30 +0530
commit84125094b25c2e5c03f2c65b87167f8291aaab5f (patch)
treeba5244f4b873eddfc7d776b1e1c71a9d15c55ad6 /modules/desktop/eww/activate-windows.py
parentdd76ef7e28a15b095de6afe61a825281f90df1be (diff)
downloadhome-manager-config-84125094b25c2e5c03f2c65b87167f8291aaab5f.tar.gz
home-manager-config-84125094b25c2e5c03f2c65b87167f8291aaab5f.zip
desktop: added styles for active window buttons
- made the active window buttons clickable to navigate to that window
Diffstat (limited to 'modules/desktop/eww/activate-windows.py')
-rw-r--r--modules/desktop/eww/activate-windows.py14
1 files changed, 12 insertions, 2 deletions
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)