This incredibly useful tool is kind of hard to install for Linux users so I just finished a shell script that will take the latest stable build of Krita and combine it with Acly’s tool for easier deployment:
To use the script; copy it and ctrl-shift-v to past it into terminal.
To install Krita with the object/segmentation selection tools:
echo "Installing Krita to ~/.Applications/Krita (hidden in your home directory)"
INSTALL_DIR=~/.Applications/Krita
mkdir -p "$INSTALL_DIR"
cd "$INSTALL_DIR"
echo "Getting the latest download for Krita and Segmentation Tools"
BASE_KRITA_URL="https://binary-factory.kde.org/job/Krita_Stable_Appimage_Build/lastSuccessfulBuild/artifact/"
KRITA_PAGE=$(curl -s $BASE_KRITA_URL)
LATEST_KRITA_APPIMAGE=$(echo "$KRITA_PAGE" | grep -o 'krita-.*\.appimage"' | head -1 | sed 's/"$//')
LATEST_PLUGIN=$(curl -s https://api.github.com/repos/Acly/krita-ai-tools/releases/latest | grep browser_download_url | grep tar.gz | cut -d '"' -f 4)
echo "Checking to see if your version of Krita is up to date?"
if [ ! -f "$LATEST_KRITA_APPIMAGE" ]; then
echo "Downloading new Krita"
wget -O "$LATEST_KRITA_APPIMAGE" "${BASE_KRITA_URL}${LATEST_KRITA_APPIMAGE}"
chmod +x "$LATEST_KRITA_APPIMAGE"
"./$LATEST_KRITA_APPIMAGE" --appimage-extract
else
echo "Latest Krita is already installed; moving on."
fi
echo "Updating the desktop file with correct paths"
EXTRACTED_DESKTOP_FILE="$INSTALL_DIR/squashfs-root/org.kde.krita.desktop"
ICON_PATH="$INSTALL_DIR/squashfs-root/krita.png"
if [ -f "$EXTRACTED_DESKTOP_FILE" ]; then
echo "Pointing shortcut to Krita and tools"
sed -i 's|^Exec=.*|Exec=env APPDIR='$INSTALL_DIR'/squashfs-root APPIMAGE=1 '$INSTALL_DIR'/squashfs-root/AppRun %U|' "$EXTRACTED_DESKTOP_FILE"
sed -i 's|^Icon=.*|Icon='$ICON_PATH'|' "$EXTRACTED_DESKTOP_FILE"
cp "$EXTRACTED_DESKTOP_FILE" ~/.local/share/applications/
else
echo "Extracted desktop file not found, it could have been moved."
fi
echo "Checking if segmentation plugin is outdated"
if [ ! -f "$(basename "$LATEST_PLUGIN")" ]; then
echo "Downloading new plugin"
wget -O "$(basename "$LATEST_PLUGIN")" "$LATEST_PLUGIN"
tar -xf "$(basename "$LATEST_PLUGIN")" -C squashfs-root/
else
echo "Latest segmentation plugin is already installed."
fi
echo "DONE! Installed Krita with Segmentation tools built in."
echo "For more info go here: https://github.com/Acly/krita-ai-tools"
The script will check whether you have the latest version; as it will keep the download files to check against to help you avoid unnecessary downloads. If you’re outdated, it will grab the latest Krita AppImage and plugin Tar; extracting the app image and then the tar into the extracted folder. Next the script grabs a copy of the included desktop file and modifies it to execute krita at the same time as the third party technology.
Meaning after you run this script; Krita and segmentation tools are installed and you can find it in the application list and pin the new Krita icon to your panel for easy access.
I also included a script to properly uninstall all associated data, and you even have the option of keeping your resource folder:
To uninstall:
# Ask for confirmation to uninstall Krita
read -p "Really, uninstall Krita? [Y/N] " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
# Define directories and files
INSTALL_DIR=~/.Applications/Krita
DESKTOP_FILE=~/.local/share/applications/org.kde.krita.desktop
RESOURCE_DIR=~/.local/share/krita
LOG_FILES=(~/.local/share/krita.log ~/.local/share/krita-sysinfo.log)
# Ask whether to remove all related resources and log files
echo "Uninstall all related resources and log files? [Y/N]"
read -p "" -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
# Full Uninstall: Remove Krita, resource folders, and log files
rm -rf "$INSTALL_DIR" "$DESKTOP_FILE" "$RESOURCE_DIR" "${LOG_FILES[@]}"
echo "Full uninstall completed, including resources and log files."
else
# Standard Uninstall: Remove Krita and desktop file, preserve resources and logs
rm -rf "$INSTALL_DIR" "$DESKTOP_FILE"
echo "Uninstall completed, resources and log files preserved."
fi
else
echo "Uninstall aborted."
fi
It took me 4-6 long days to figure out how to make it; hope someone finds it useful!
However I would not have completed it without the help of @Michelist for pointing me to the right command for getting latest Krita stable from repo.
I hope this saves you time on assembling your favourite art tools.
Happy Krita painting.