Skip to content

foss-art-install_v0.0.3

Latest

Choose a tag to compare

@SimonHeggie SimonHeggie released this 05 Aug 04:44
aaf910f

Krita FOSS Installer — v0.0.3

✅ Structural Overhaul

  • Renamed krita_install/krita/
    → clearer structure, consistent with ardour/
  • Moved archives_k/ under krita/
    → resolves path bugs, ensures app-scoped cache
  • Unified version tracking to root version file
    → replaces .version_k

✂️ Removed

  • k-addon_segmentation.sh
    → deprecated in favor of modern Vision Tools

🧠 Added

  • k-addon_vision_tools.sh
    → full install of Krita Vision Tools v2.0.0 (segmentation + selection)
  • required.sh
    → intelligent system dependency checker with multi-distro support
  • k-comfyui_shortcut.sh
    → auto-generates .desktop launcher for ComfyUI

⚙️ Improvements

  • Centralised path config via paths.conf and paths_k.conf
  • Modular addon scripts with shared logging, cache handling, and install validation
  • AppImage validation and repair logic rewritten
  • All .desktop entries patched dynamically for clean KDE/GNOME support

📦 Addons

🧩 Krita Vision Tools

  • Installed via k-addon_vision_tools.sh
  • Source: Acly/krita-ai-tools
  • Versioned as:
    VISIONTOOLS=v2.0.0
    
  • Archive path:
    krita/archives_k/vision_tools.zip
    
  • Extracted to:
    ~/.Applications/Krita/squashfs-root/usr/share/krita/pykrita
    
  • Skips re-download if archive and version match
  • Uses curl --http1.1 to avoid GitHub HTTP/2 bugs

🎨 AI Diffusion Addon

  • Installed via k-addon_ai_diffusion.sh
  • ACLY-style image generation toolkit
  • Versioned as:
    AIDIFFUSION=v1.36.1
    
  • Archive path:
    krita/archives_k/ai_diffusion.zip
    
  • Extracted to:
    ~/.Applications/Krita/squashfs-root/usr/share/krita/pykrita
    

🌐 ComfyUI Web App Launcher

  • Installed via k-comfyui_shortcut.sh
  • Generates .desktop file with WM_CLASS override for clean taskbar icon
  • Works best on KDE + Brave Browser
  • Installs to:
    ~/.local/share/applications/ComfyUI.desktop
    
  • Also patches:
    ~/.Applications/ComfyUI/server/settings.json
    
  • Falls back to system default browser if Brave is not available

Installation:

NOTE! ACLY made a big change that requires reinstall. If you were using the previous script version, then do a full install of all desired components

Simply run the following from which ever location you'd like to backup your install archive, otherwise this will run automatically from your downloads folder:

Bootstrap Script (krita.sh)
#!/usr/bin/env bash

# ─── Define Installer Version ────────────────────────────────────────
FOSS_INSTALL_VERSION="v0.0.3"

# ─── Work in ~/Downloads if invoked from $HOME ───────────────────────
if [ "$PWD" = "$HOME" ]; then
  cd "$HOME/Downloads/foss-art-install/" || exit 1
fi

# ─── Main Logic in Subshell (inherits PATH) ──────────────────────────
(
set -euo pipefail
IFS=$'\n\t'

BOOT_DIR="$(pwd)"
INSTALL_DIR="$BOOT_DIR/krita"
INSTALL_SCRIPT="$INSTALL_DIR/install_krita.sh"
UNINSTALL_SCRIPT="$INSTALL_DIR/uninstall_krita.sh"
VERSION_FILE="$BOOT_DIR/version"
ARCHIVE_TEMP="foss-art-install.zip"

PYKRITA_DIR="$HOME/.Applications/Krita/squashfs-root/usr/share/krita/pykrita"
COMFY_DESKTOP_FILE="$HOME/.local/share/applications/ComfyUI.desktop"

GITHUB_LATEST_URL="https://github.com/SimonHeggie/FOSS-Artist-workflow-Guide/releases/latest/download/foss-art-install.zip"

# ─── Dependency Check via required.sh ────────────────────────────────
chmod +x "$BOOT_DIR/required.sh"
"$BOOT_DIR/required.sh" || {
  echo "[ERROR] Missing system requirements. Aborting." >&2
  exit 1
}

# ─── Check Version ───────────────────────────────────────────────────
CURRENT_VERSION="none"
if [ -f "$VERSION_FILE" ]; then
  CURRENT_VERSION=$(awk -F= '/^FOSS_INSTALL=/{print $2}' "$VERSION_FILE" || echo "none")
fi

if [ "$CURRENT_VERSION" != "$FOSS_INSTALL_VERSION" ] && [ "$CURRENT_VERSION" != "none" ]; then
  echo "[INFO] Updating bootstrap to latest version from GitHub..."
  curl -fL "$GITHUB_LATEST_URL" -o "$ARCHIVE_TEMP"
  unzip -o "$ARCHIVE_TEMP" >/dev/null 2>&1
  rm -f "$ARCHIVE_TEMP"
  if [ ! -f "$BOOT_DIR/krita/krita.sh" ]; then
    echo "[ERROR] Downloaded archive does not contain krita.sh" >&2
    exit 1
  fi
  chmod +x "$BOOT_DIR/krita/krita.sh"
  echo "[INFO] Replacing self with updated krita.sh..."
  echo "FOSS_INSTALL=$FOSS_INSTALL_VERSION" > "$VERSION_FILE"
  exec "$BOOT_DIR/krita/krita.sh"
fi

# ─── Ensure Installer is Present ─────────────────────────────────────
echo "[BOOT] Checking krita folder..."
if [ -d "$INSTALL_DIR" ]; then
  echo "[INFO] Found existing ./krita — skipping download."
else
  echo "[INFO] krita/ not found. Downloading latest installer..."
  curl -fL "$GITHUB_LATEST_URL" -o "$ARCHIVE_TEMP"
  echo "[INFO] Extracting installer..."
  unzip -o "$ARCHIVE_TEMP" >/dev/null
  rm -f "$ARCHIVE_TEMP"
  [ -d "$INSTALL_DIR" ] || { echo "[ERROR] Expected folder 'krita/' not found after extraction." >&2; exit 1; }
fi

if [ ! -f "$INSTALL_SCRIPT" ]; then
  echo "[ERROR] Missing install_krita.sh inside krita/ — aborting." >&2
  ls -l "$INSTALL_DIR"
  exit 1
fi

# ─── Menu: First-Time Install ───────────────────────────────────────
if [ "$CURRENT_VERSION" = "none" ]; then
  echo "[INFO] Krita not installed."
  echo "[I]   Install Krita + Vision Tools"
  echo "[AI]  Install Krita + AI Diffusion"
  echo "[AIC] Install Krita + AI + ComfyUI shortcut"
  echo "[Q]   Quit"
  printf "Select an option: "
  read -r option

  case "$option" in
    [Ii])         bash "$INSTALL_SCRIPT" ;;
    [Aa][Ii])     bash "$INSTALL_SCRIPT" --with-ai ;;
    [Aa][Ii][Cc]) bash "$INSTALL_SCRIPT" --with-ai --with-comfy ;;
    [Qq])         echo "Goodbye!" && exit 0 ;;
    *)            echo "Invalid input." && exit 1 ;;
  esac

  sed -i "/^FOSS_INSTALL=/d" "$VERSION_FILE" 2>/dev/null || true
  echo "FOSS_INSTALL=$FOSS_INSTALL_VERSION" >> "$VERSION_FILE"
  exit 0
fi

# ─── Installed Menu ──────────────────────────────────────────────────
echo "[INFO] Krita install detected."
echo "[INFO] Installed versions:"
grep -E "^(FOSS_INSTALL|KRITA|AIDIFFUSION|VISIONTOOLS)=" "$VERSION_FILE" || true

AI_STATUS="OK"; COMFY_STATUS="OK"; VISION_STATUS="OK"
if ! find "$PYKRITA_DIR" -type f -iname "diffusion.py" 2>/dev/null | grep -q .; then AI_STATUS="MISSING"; fi
[ -f "$COMFY_DESKTOP_FILE" ] || COMFY_STATUS="MISSING"
grep -q "^VISIONTOOLS=" "$VERSION_FILE" 2>/dev/null || VISION_STATUS="MISSING"

echo
echo "[STATUS] Krita: OK   Vision Tools: $VISION_STATUS   AI Diffusion: $AI_STATUS   ComfyUI Shortcut: $COMFY_STATUS"
echo
echo "[I]   Install latest with Vision Tools (overwrite, update version)"
echo "[AI]  Add AI Diffusion only"
echo "[AIC] Add AI Diffusion + ComfyUI shortcut"
echo "[D]   Download archives only"
echo "[R]   Repair (re-extract AppImage + reinstall addons)"
echo "[U]   Uninstall"
echo "[Q]   Quit"
printf "Select an option: "
read -r option
case "$option" in
  [Aa][Ii][Cc]) bash "$INSTALL_SCRIPT" --with-ai --with-comfy ;;
  [Aa][Ii])     bash "$INSTALL_SCRIPT" --with-ai ;;
  [Ii])         bash "$INSTALL_SCRIPT" ;;
  [Dd])         bash "$INSTALL_SCRIPT" --download-only ;;
  [Rr])         bash "$INSTALL_SCRIPT" --repair ;;
  [Uu])         bash "$UNINSTALL_SCRIPT" --complete ;;
  [Qq])         echo "Goodbye!" && exit 0 ;;
  *)            echo "Invalid input." && exit 1 ;;
esac

sed -i "/^FOSS_INSTALL=/d" "$VERSION_FILE" 2>/dev/null || true
echo "FOSS_INSTALL=$FOSS_INSTALL_VERSION" >> "$VERSION_FILE"

) # ← End of subshell

🖥️ Installer Interface (krita.sh)

When Krita is not installed:

[I]   Install Krita + Vision Tools
[AI]  Install Krita + AI Diffusion
[AIC] Install Krita + AI + ComfyUI shortcut
[Q]   Quit

When Krita is already installed:

[INFO] Installed versions:
FOSS_INSTALL=...
KRITA=...
AIDIFFUSION=...
VISIONTOOLS=...

[STATUS] Krita: OK   Vision Tools: OK/MISSING   AI Diffusion: OK/MISSING   ComfyUI Shortcut: OK/MISSING

[I]   Install latest with Vision Tools (overwrite)
[AI]  Add AI Diffusion only
[AIC] Add AI Diffusion + ComfyUI shortcut
[D]   Download archives only
[R]   Repair install (re-extract AppImage + addons)
[U]   Uninstall
[Q]   Quit

🧠 Version Tracking (version file)

Stored at:

foss-art-install/version

Sample contents:

FOSS_INSTALL=v0.0.3
KRITA=5.2.11
AIDIFFUSION=v1.36.1
VISIONTOOLS=v2.0.0

Used to:

  • Skip unnecessary downloads
  • Trigger repair logic
  • Determine what’s installed and synced

🧪 Linux Compatibility Matrix

✅ Fully Supported

Distro Desktop Status Notes
Nobara 42 KDE ✅ Tested Native target. Full support.
Fedora KDE KDE ✅ Expected Same base as Nobara.
KDE Neon KDE ✅ Expected Plasma-optimized.
Kubuntu KDE ✅ Expected Clean Ubuntu-based setup.
Debian KDE KDE ✅ Expected Ensure sudo/curl are present.
Manjaro KDE KDE ✅ Expected Now compatible via required.sh.
Arch KDE KDE ✅ Expected Supports fallback to su -c.
EndeavourOS KDE KDE ✅ Expected Arch-based, compatible.
openSUSE KDE KDE ✅ Expected Tested with zypper install logic.

⚠️ Partial Support

Distro Desktop Status Issues
Ubuntu (GNOME) GNOME ⚠️ .desktop opens tabs, not app windows
Pop!_OS GNOME ⚠️ Same as Ubuntu
Zorin OS GNOME ⚠️ Hybrid shell; window behavior inconsistent
Linux Mint Cinnamon ⚠️ Taskbar icon + window separation unreliable
Fedora (GNOME) GNOME ⚠️ .desktop file behavior differs

Installer runs fine, but .desktop launcher behavior may vary outside KDE.


❌ Not Yet Supported

Distro Reason
Alpine Linux musl libc breaks bash/coreutils assumptions
Clear Linux Non-FHS layout; nonstandard install paths
Elementary OS Ignores .desktop without AppCenter-compliant bundle
Slackware No XDG directories; requires manual .desktop setup

If you would like your particular distro to be supported, then please help me by testing and submitting all install logs to the issues section. I need all the help I can get ensuring this works all all Linux platforms.


🧱 File Structure Overview

foss-art-install/
├── krita/
│   ├── install_krita.sh
│   ├── uninstall_krita.sh
│   ├── addons_k/
│   │   ├── k-addon_vision_tools.sh
│   │   ├── k-addon_ai_diffusion.sh
│   │   └── k-comfyui_shortcut.sh
│   ├── archives_k/
│   │   ├── krita.appimage
│   │   ├── vision_tools.zip
│   │   └── ai_diffusion.zip
├── required.sh
├── krita.sh
├── version

Keep archives_k/ intact to avoid unnecessary re-downloads.


✅ Future Enhancements

  • Better GNOME & Cinnamon launcher compatibility
  • Optional desktop environment detection for smarter .desktop behavior
  • Isolated fallback browsers for non-Brave setups
  • Windows/Mac support (eventually)