aboutsummaryrefslogtreecommitdiffstats
path: root/deckit/server.py
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-11-10 16:34:04 +0100
committerDanilo M. <danix@danix.xyz>2026-11-10 16:34:04 +0100
commit5a8da8ab392266d5f3bbf3abed61472d6734f31c (patch)
treef5c95722e93515d9bcb527345fe8994333ead568 /deckit/server.py
parent25c0248a3285c30b12df9d228a13e435786b66f7 (diff)
downloaddeck-it-5a8da8ab392266d5f3bbf3abed61472d6734f31c.tar.gz
deck-it-5a8da8ab392266d5f3bbf3abed61472d6734f31c.zip
feat(windows): preview cards and keystone's workspace icons
Each window is a card like the Alt+Tab switcher's: a preview in the window's shape (grim -T on Hyprland's stableId, also for hidden workspaces, refreshed every 5 s), the desktop top left, close top right, the app icon bottom left, each on its own scrim, the title below. Tap focuses, a long press opens the move menu at the press point (the grid re-renders under a title that changes every second, so the card itself may already be gone), and Chrome's image menu is suppressed. Module.image serves module images at /api/<module>/image/<key>; windows answers only for a window the last state listed. Workspace tiles, card markers and the move menu use the icons from keystone's Workspaces.qml, falling back to the number; the icon route also searches the theme's places, preferences and categories folders, where two of them live. The workspaces are centred. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'deckit/server.py')
-rw-r--r--deckit/server.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/deckit/server.py b/deckit/server.py
index 19edbef..9dd5229 100644
--- a/deckit/server.py
+++ b/deckit/server.py
@@ -89,7 +89,11 @@ def icon_path(name: str, theme: str | None = None, bases=ICON_BASES):
for th in (theme or icon_theme(), "hicolor"):
for base in bases:
# Themes lay out category/size (candy-icons) or size/category (hicolor).
- for sub in ("apps/scalable", "apps/64", "apps/48", "apps/32", "scalable/apps"):
+ # Apps first; places and preferences hold the workspace icons
+ # keystone's bar uses (network-server, applications-graphics).
+ for sub in ("apps/scalable", "apps/64", "apps/48", "apps/32", "scalable/apps",
+ "places/scalable", "places/48", "scalable/places",
+ "preferences/scalable", "categories/scalable", "scalable/categories"):
path = Path(base) / th / sub / f"{name}.svg"
if path.is_file():
return path
@@ -207,6 +211,13 @@ class Handler(BaseHTTPRequestHandler):
if len(parts) == 2 and parts[1] == "bg":
image = background()
return self._send(200, image[0], image[1], cache=True) if image else self._send(404)
+ if len(parts) == 4 and parts[2] == "image":
+ try:
+ fn = REGISTRY.get(parts[1]).image
+ except module.ModuleError:
+ fn = None
+ image = fn(parts[3]) if fn else None
+ return self._send(200, image[0], image[1], cache=True) if image else self._send(404)
if len(parts) == 2 and parts[1] == "modules":
return self._json(REGISTRY.names())
if len(parts) == 2: