snap/snapcraft.yaml builds the Linux app as a strictly confined Snap on core24 with the GNOME extension (GTK, WebKitGTK, GStreamer and libsecret come from its runtime; files and the browser go through the desktop's portals), connecting to learn.halkyon.eu, the project's instance. It builds what is committed, with Flutter pinned as in CI. - The session: libsecret's keyring over D-Bus needs the password-manager-service plug, which the Store never connects by itself, so unless it is connected the app keeps the session in an encrypted file whose key comes from the Secret portal (snap/local/secret-backend). - network-manager-observe lets Serverpod hear that the network went and end the sync's connection at once; until the Store grants it, it too is connected by hand. - The listing points to the project, not the instance: the website learn.halkyon.app, contact and issues support@halkyon.app. - The icon is the app's with rounded corners (tool/snap_icon.py), for the Store and the dock alike. - The app's version is 0.1.0, build 1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
47 lines
1.6 KiB
Python
Executable file
47 lines
1.6 KiB
Python
Executable file
#!/usr/bin/env python3
|
|
"""Makes the snap's icon from the app's: the same picture with rounded corners.
|
|
|
|
The app's icon is a white square, which the Snap Store and the desktop's dock
|
|
show as it is, so the snap's icon rounds its corners off to transparency. The
|
|
radius, 142.222 of 512 pixels (about 28 %), is the one other desktop apps'
|
|
white rounded tiles use. The mask is drawn at four times the size and scaled
|
|
down, so the corners' edges are smooth.
|
|
|
|
Run from the repository root with Python 3 and Pillow (python3-pil on Ubuntu):
|
|
|
|
python3 tool/snap_icon.py
|
|
|
|
It rewrites snap/gui/halkyon-learn.png (512 x 512 pixels, the Store's size),
|
|
used by both the Store listing and the desktop file.
|
|
"""
|
|
|
|
from pathlib import Path
|
|
|
|
from PIL import Image, ImageDraw
|
|
|
|
SOURCE = Path("halkyon_learn_flutter/assets/icon/halkyon_icon.png")
|
|
TARGET = Path("snap/gui/halkyon-learn.png")
|
|
SIZE = 512
|
|
RADIUS = 142.222
|
|
SUPERSAMPLING = 4
|
|
|
|
|
|
def main() -> None:
|
|
icon = Image.open(SOURCE).convert("RGBA").resize((SIZE, SIZE), Image.LANCZOS)
|
|
|
|
large = SIZE * SUPERSAMPLING
|
|
mask = Image.new("L", (large, large), 0)
|
|
ImageDraw.Draw(mask).rounded_rectangle(
|
|
(0, 0, large - 1, large - 1), radius=RADIUS * SUPERSAMPLING, fill=255
|
|
)
|
|
mask = mask.resize((SIZE, SIZE), Image.LANCZOS)
|
|
|
|
# Keeps what the icon itself makes transparent, and takes the corners away.
|
|
transparent = Image.new("L", (SIZE, SIZE), 0)
|
|
icon.putalpha(Image.composite(icon.getchannel("A"), transparent, mask))
|
|
icon.save(TARGET, optimize=True)
|
|
print(f"Wrote {TARGET} ({TARGET.stat().st_size} bytes).")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|