diff options
Diffstat (limited to 'deckit/server.py')
| -rw-r--r-- | deckit/server.py | 13 |
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: |
