Skip to content

Commit e81ea3e

Browse files
committed
Copying all icons into AppImage... into correct XDG Freedesktop icon paths
1 parent 7085fb8 commit e81ea3e

File tree

1 file changed

+24
-14
lines changed

1 file changed

+24
-14
lines changed

installer/build-server.py

+24-14
Original file line numberDiff line numberDiff line change
@@ -326,25 +326,35 @@ def parse_version_info(version_path):
326326

327327
# Recursively create AppDir /usr folder
328328
os.makedirs(os.path.join(app_dir_path, "usr"), exist_ok=True)
329-
330-
# Install program icon (as a 128x128 PNG & SVG)
331-
icon_svg = os.path.join(PATH, "xdg", "openshot-qt.svg")
332-
icon_128_png = os.path.join(PATH, "xdg", "icon", "128", "openshot-qt.png")
333-
shutil.copyfile(icon_128_png, os.path.join(app_dir_path, "openshot-qt.png"))
334-
shutil.copyfile(icon_svg, os.path.join(app_dir_path, "openshot-qt.svg"))
335-
336-
# Install .DirIcon AppImage icon
329+
os.makedirs(os.path.join(app_dir_path, "usr", "share", "icons", "hicolor", "scalable", "apps", "xdg"), exist_ok=True)
330+
331+
# XDG Freedesktop icon paths
332+
icons = [ ("scalable", os.path.join(PATH, "xdg", "openshot-qt.svg")),
333+
("64x64", os.path.join(PATH, "icon", "64", "openshot-qt.png")),
334+
("128x128", os.path.join(PATH, "icon", "128", "openshot-qt.png")),
335+
("256x256", os.path.join(PATH, "icon", "256", "openshot-qt.png")),
336+
("512x512", os.path.join(PATH, "icon", "512", "openshot-qt.png")),
337+
]
338+
339+
# Copy desktop icons
340+
icon_theme_path = os.path.join(app_dir_path, "usr", "share", "icons", "hicolor")
341+
342+
# Copy each icon
343+
for icon_size, icon_path in icons:
344+
dest_icon_path = os.path.join(icon_theme_path, icon_size, "apps", os.path.split(icon_path)[-1])
345+
os.makedirs(os.path.split(dest_icon_path)[0], exist_ok=True)
346+
shutil.copyfile(icon_path, dest_icon_path)
347+
348+
# Install .DirIcon AppImage icon (256x256)
337349
# See: https://docs.appimage.org/reference/appdir.html
338-
# SVG icon not supported on Chrome OS (with AppImage desktop integration)
339-
# PNG is assumed with desktop integration
340-
shutil.copyfile(icon_128_png, os.path.join(app_dir_path, ".DirIcon"))
350+
shutil.copyfile(icons[3][1], os.path.join(app_dir_path, ".DirIcon"))
341351

342352
dest = os.path.join(app_dir_path, "usr", "share", "pixmaps")
343353
os.makedirs(dest, exist_ok=True)
344354

345-
# Copy pixmaps (as a 128x128 PNG & SVG)
346-
shutil.copyfile(icon_128_png, os.path.join(dest, "openshot-qt.png"))
347-
shutil.copyfile(icon_svg, os.path.join(dest, "openshot-qt.svg"))
355+
# Copy pixmaps (as a 64x64 PNG & SVG)
356+
shutil.copyfile(icons[0][1], os.path.join(dest, "openshot-qt.svg"))
357+
shutil.copyfile(icons[1][1], os.path.join(dest, "openshot-qt.png"))
348358

349359
# Install MIME handler
350360
dest = os.path.join(app_dir_path, "usr", "share", "mime", "packages")

0 commit comments

Comments
 (0)