Give the app an icon and a place in the application menu

icon.svg is the source; make_icons.py rasterises it into assets/icon-<size>.png
at the six sizes a window manager asks for. Tk 8.6 reads PNG but not SVG, so
the icon has to ship pre-rendered, and the glyph is laid on a rounded plate in
the app's own colours — light on dark stays legible against both a light and a
dark dock, which slate grey on nothing does not.

ui.py loads whichever of those files exist and passes them all to iconphoto(),
letting the WM pick per context (title bar, alt-tab, dock). The images are kept
on the instance because Tk holds only a weak reference to a PhotoImage and the
icon blanks out when it is collected. A missing or unreadable file is ignored
rather than allowed to fail a launch.

It also passes className="lektor-ai", which lands in WM_CLASS. Without it Tk
calls itself "Tk" and that is what the dock shows on hover; the readable name
comes from the desktop entry, which matches the window through StartupWMClass.

install_desktop.sh writes ~/.local/share/applications/lektor-ai.desktop and
copies the icons into the hicolor theme, so the app appears in the menu and can
be pinned. Everything it installs lives under ~/.local and comes back out with
--uninstall.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NkWDx9dVB7xBpqntvjvm6A
This commit is contained in:
2026-08-31 21:14:36 +02:00
co-authored by Claude Opus 5
parent 4a9b05de66
commit d350b314ad
10 changed files with 184 additions and 1 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 676 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB