Created
February 7, 2026 07:40
-
-
Save loopyd/3bbc984631afcf8d8768d8dbd04d0865 to your computer and use it in GitHub Desktop.
[bash] Install Aseprite pixel editor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -eo pipefail | |
| C_RED=$(tput setaf 1) | |
| C_GREEN=$(tput setaf 2) | |
| C_RESET=$(tput sgr0) | |
| fail() { | |
| echo "${C_RED}Error: $1${C_RESET}" >&2 | |
| exit 1 | |
| } | |
| ASEPRITE_VERSION="v1.3.16.1" | |
| INSTALL_DIR="/usr/local/aseprite" | |
| SYMLINK_PATH="/usr/bin/aseprite" | |
| CSCRIPT_DIR=$(dirname "$(realpath "$0")") | |
| TMP_DIR="/tmp/aseprite" | |
| sudo apt-get update || fail "Failed to update package lists" | |
| sudo apt-get install -y libxcb1-dev xorg-dev libssl-dev || fail "Failed to install dependencies for Aseprite" | |
| if [ ! -d "${TMP_DIR}" ]; then | |
| mkdir -p "${TMP_DIR}" || fail "Failed to create temporary directory at ${TMP_DIR}" | |
| else | |
| echo "${C_GREEN}Temporary directory ${TMP_DIR} already exists.${C_RESET}" | |
| fi | |
| if [ "$(ls -A ${TMP_DIR})" ]; then | |
| echo "${C_GREEN}Aseprite source already exists in ${TMP_DIR}. Cleaning it up...${C_RESET}" | |
| cd "${TMP_DIR}" || fail "Failed to change directory to Aseprite source" | |
| git fetch origin || fail "Failed to fetch latest Aseprite source" | |
| git checkout "${ASEPRITE_VERSION}" || fail "Failed to checkout Aseprite version" | |
| git clean -dxf || fail "Failed to clean Aseprite source directory" | |
| cd "${CSCRIPT_DIR}" || fail "Failed to change directory back to script location" | |
| else | |
| echo "${C_GREEN}Cloning Aseprite source code to ${TMP_DIR}.${C_RESET}" | |
| git clone --branch "${ASEPRITE_VERSION}" https://github.com/aseprite/aseprite.git "${TMP_DIR}" || fail "Failed to clone Aseprite repository" | |
| fi | |
| echo "${C_GREEN}Building Aseprite from source...${C_RESET}" | |
| cd "${TMP_DIR}" || fail "Failed to change directory to Aseprite source" | |
| sudo chmod +x ./build.sh || fail "Failed to make build script executable" | |
| ./build.sh --auto --norun || fail "Failed to build Aseprite" | |
| if [ -d "${INSTALL_DIR}" ]; then | |
| echo "${C_GREEN}Aseprite installation directory ${INSTALL_DIR} already exists, removing it to proceed with installation.${C_RESET}" | |
| sudo rm -rf "${INSTALL_DIR}" || fail "Failed to remove existing installation directory at ${INSTALL_DIR}" | |
| fi | |
| sudo mkdir -p "${INSTALL_DIR}" || fail "Failed to create installation directory at ${INSTALL_DIR}" | |
| sudo cp -r ${TMP_DIR}/build/* "${INSTALL_DIR}/" || fail "Failed to copy Aseprite files to installation directory" | |
| echo "${C_GREEN}Copied Aseprite files to ${INSTALL_DIR}.${C_RESET}" | |
| if [ ! -L "${SYMLINK_PATH}" ] && [ ! -e "${SYMLINK_PATH}" ]; then | |
| sudo ln -sf "${INSTALL_DIR}/bin/aseprite" "${SYMLINK_PATH}" || fail "Failed to create symbolic link for Aseprite at ${SYMLINK_PATH}" | |
| echo "${C_GREEN}Created symlink for Aseprite at ${SYMLINK_PATH}.${C_RESET}" | |
| else | |
| echo "${C_GREEN}Aseprite symlink already exists at ${SYMLINK_PATH}.${C_RESET}" | |
| fi | |
| if [ -f "/usr/share/applications/aseprite.desktop" ]; then | |
| echo "${C_GREEN}Aseprite desktop entry already exists.${C_RESET}" | |
| else | |
| cat <<EOF | sudo tee /usr/share/applications/aseprite.desktop | |
| [Desktop Entry] | |
| Name=Aseprite | |
| Comment=Pixel art creation and animation tool | |
| Exec=${SYMLINK_PATH} | |
| Icon=${INSTALL_DIR}/bin/data/icons/ase.ico | |
| Terminal=false | |
| Type=Application | |
| Categories=Graphics; | |
| EOF | |
| if [ $? -ne 0 ]; then | |
| fail "Failed to create Aseprite desktop entry" | |
| fi | |
| sudo chmod +x /usr/share/applications/aseprite.desktop || fail "Failed to set executable permission on Aseprite desktop entry" | |
| echo "${C_GREEN}Created Aseprite desktop entry.${C_RESET}" | |
| fi | |
| if command -v update-desktop-database >/dev/null 2>&1; then | |
| sudo update-desktop-database /usr/share/applications/ || fail "Failed to update desktop database" | |
| echo "${C_GREEN}Updated desktop database.${C_RESET}" | |
| fi | |
| [ -d "${TMP_DIR}" ] && { | |
| rm -rf "${TMP_DIR}" || fail "Failed to remove temporary directory at ${TMP_DIR}" | |
| echo "${C_GREEN}Removed temporary directory ${TMP_DIR}.${C_RESET}" | |
| } | |
| echo "${C_GREEN}Aseprite ${ASEPRITE_VERSION} installed successfully!${C_RESET}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment