From 4f23d25511799df516d20c4913c2fe138770562e Mon Sep 17 00:00:00 2001 From: lashman Date: Fri, 6 Mar 2026 18:31:18 +0200 Subject: [PATCH] Add AppImage packaging, app icon, and AppStream metainfo --- build-appimage.sh | 105 ++++++++++++++++++ .../scalable/apps/live.lashman.Pixstrip.svg | 53 +++++++++ data/live.lashman.Pixstrip.metainfo.xml | 63 +++++++++++ pixstrip-gtk/src/app.rs | 1 + 4 files changed, 222 insertions(+) create mode 100644 build-appimage.sh create mode 100644 data/icons/hicolor/scalable/apps/live.lashman.Pixstrip.svg create mode 100644 data/live.lashman.Pixstrip.metainfo.xml diff --git a/build-appimage.sh b/build-appimage.sh new file mode 100644 index 0000000..53eba12 --- /dev/null +++ b/build-appimage.sh @@ -0,0 +1,105 @@ +#!/bin/bash +set -euo pipefail + +# Build Pixstrip AppImage +# Requires: cargo, linuxdeploy (with gtk plugin), appimagetool +# Usage: ./build-appimage.sh [--release] + +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +BUILD_TYPE="release" +CARGO_FLAGS="--release" + +if [[ "${1:-}" == "--debug" ]]; then + BUILD_TYPE="debug" + CARGO_FLAGS="" +fi + +APP_ID="live.lashman.Pixstrip" +APP_DIR="$SCRIPT_DIR/AppDir" +TOOLS_DIR="$SCRIPT_DIR/build-tools" + +echo "=== Building Pixstrip AppImage ($BUILD_TYPE) ===" + +# Step 1: Build binaries +echo "--- Building binaries ---" +cargo build $CARGO_FLAGS --workspace + +# Step 2: Create AppDir structure +echo "--- Creating AppDir ---" +rm -rf "$APP_DIR" +mkdir -p "$APP_DIR/usr/bin" +mkdir -p "$APP_DIR/usr/share/applications" +mkdir -p "$APP_DIR/usr/share/icons/hicolor/scalable/apps" +mkdir -p "$APP_DIR/usr/share/metainfo" + +# Step 3: Copy binaries +cp "target/$BUILD_TYPE/pixstrip-gtk" "$APP_DIR/usr/bin/pixstrip-gtk" +cp "target/$BUILD_TYPE/pixstrip-cli" "$APP_DIR/usr/bin/pixstrip" + +# Step 4: Copy desktop file, icon, metainfo +cp "data/$APP_ID.desktop" "$APP_DIR/usr/share/applications/" +cp "data/icons/hicolor/scalable/apps/$APP_ID.svg" "$APP_DIR/usr/share/icons/hicolor/scalable/apps/" +cp "data/$APP_ID.metainfo.xml" "$APP_DIR/usr/share/metainfo/" + +# Symlinks required by AppImage spec +ln -sf "usr/share/applications/$APP_ID.desktop" "$APP_DIR/$APP_ID.desktop" +ln -sf "usr/share/icons/hicolor/scalable/apps/$APP_ID.svg" "$APP_DIR/$APP_ID.svg" + +# Step 5: Create AppRun +cat > "$APP_DIR/AppRun" << 'APPRUN' +#!/bin/bash +SELF="$(readlink -f "$0")" +HERE="${SELF%/*}" +export PATH="${HERE}/usr/bin:${PATH}" +export LD_LIBRARY_PATH="${HERE}/usr/lib:${HERE}/usr/lib/x86_64-linux-gnu:${LD_LIBRARY_PATH:-}" +export XDG_DATA_DIRS="${HERE}/usr/share:${XDG_DATA_DIRS:-/usr/local/share:/usr/share}" +export GI_TYPELIB_PATH="${HERE}/usr/lib/x86_64-linux-gnu/girepository-1.0:${GI_TYPELIB_PATH:-}" +exec "${HERE}/usr/bin/pixstrip-gtk" "$@" +APPRUN +chmod +x "$APP_DIR/AppRun" + +# Step 6: Bundle shared libraries +echo "--- Bundling libraries ---" +mkdir -p "$TOOLS_DIR" + +# Download linuxdeploy if not present +if [[ ! -x "$TOOLS_DIR/linuxdeploy" ]]; then + echo "Downloading linuxdeploy..." + wget -q -O "$TOOLS_DIR/linuxdeploy" \ + "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" + chmod +x "$TOOLS_DIR/linuxdeploy" +fi + +# Download linuxdeploy GTK plugin if not present +if [[ ! -x "$TOOLS_DIR/linuxdeploy-plugin-gtk.sh" ]]; then + echo "Downloading linuxdeploy GTK plugin..." + wget -q -O "$TOOLS_DIR/linuxdeploy-plugin-gtk.sh" \ + "https://raw.githubusercontent.com/linuxdeploy/linuxdeploy-plugin-gtk/master/linuxdeploy-plugin-gtk.sh" + chmod +x "$TOOLS_DIR/linuxdeploy-plugin-gtk.sh" +fi + +# Use linuxdeploy to bundle dependencies +export DEPLOY_GTK_VERSION=4 +"$TOOLS_DIR/linuxdeploy" \ + --appdir "$APP_DIR" \ + --desktop-file "$APP_DIR/usr/share/applications/$APP_ID.desktop" \ + --icon-file "$APP_DIR/usr/share/icons/hicolor/scalable/apps/$APP_ID.svg" \ + --plugin gtk + +# Step 7: Build the AppImage +echo "--- Creating AppImage ---" + +# Download appimagetool if not present +if [[ ! -x "$TOOLS_DIR/appimagetool" ]]; then + echo "Downloading appimagetool..." + wget -q -O "$TOOLS_DIR/appimagetool" \ + "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage" + chmod +x "$TOOLS_DIR/appimagetool" +fi + +VERSION="0.1.0" +"$TOOLS_DIR/appimagetool" "$APP_DIR" "Pixstrip-${VERSION}-x86_64.AppImage" + +echo "" +echo "=== AppImage built: Pixstrip-${VERSION}-x86_64.AppImage ===" +echo "Size: $(du -h "Pixstrip-${VERSION}-x86_64.AppImage" | cut -f1)" diff --git a/data/icons/hicolor/scalable/apps/live.lashman.Pixstrip.svg b/data/icons/hicolor/scalable/apps/live.lashman.Pixstrip.svg new file mode 100644 index 0000000..d8c9031 --- /dev/null +++ b/data/icons/hicolor/scalable/apps/live.lashman.Pixstrip.svg @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/live.lashman.Pixstrip.metainfo.xml b/data/live.lashman.Pixstrip.metainfo.xml new file mode 100644 index 0000000..799f99d --- /dev/null +++ b/data/live.lashman.Pixstrip.metainfo.xml @@ -0,0 +1,63 @@ + + + live.lashman.Pixstrip + CC0-1.0 + CC0-1.0 + Pixstrip + Batch image processor - resize, convert, compress, and more + + +

+ Pixstrip is a batch image processor for Linux that combines resize, convert, + compress, metadata strip, watermark, rename, and basic image adjustments into + a single wizard-driven workflow. +

+

Features include:

+
    +
  • Resize images by width, height, fit-in-box, or social media presets
  • +
  • Convert between JPEG, PNG, WebP, AVIF, GIF, and TIFF
  • +
  • Compress with optimized encoders (mozjpeg, oxipng, libwebp, ravif)
  • +
  • Strip or selectively manage EXIF metadata for privacy
  • +
  • Add text or image watermarks with positioning and rotation
  • +
  • Rename files with templates, counters, regex, and EXIF variables
  • +
  • Adjust brightness, contrast, saturation, and apply effects
  • +
  • Built-in presets for common workflows
  • +
  • Watch folders for automatic processing
  • +
  • Full CLI with feature parity
  • +
+
+ + live.lashman.Pixstrip.desktop + + https://git.lashman.live/lashman/pixstrip + https://git.lashman.live/lashman/pixstrip/issues + + + lashman + + + + #99c1f1 + #1a5fb4 + + + + + + 360 + + + + pointing + keyboard + touch + + + + + +

Initial release with full wizard workflow, 8 built-in presets, CLI parity, watch folders, and file manager integration.

+
+
+
+
diff --git a/pixstrip-gtk/src/app.rs b/pixstrip-gtk/src/app.rs index 53addaf..5617c57 100644 --- a/pixstrip-gtk/src/app.rs +++ b/pixstrip-gtk/src/app.rs @@ -555,6 +555,7 @@ fn build_ui(app: &adw::Application) { .default_height(win_height) .content(&toast_overlay) .title("Pixstrip") + .icon_name(APP_ID) .build(); if session_state.window_maximized {