diff --git a/src/bin/appimage-apps/15-epic-games-launcher.sh b/src/bin/appimage-apps/15-epic-games-launcher.sh new file mode 100755 index 0000000..e11cadc --- /dev/null +++ b/src/bin/appimage-apps/15-epic-games-launcher.sh @@ -0,0 +1,57 @@ +#!/usr/bin/env bash + +# Parent Path +PARENT_PATH="/home/${USER}/appimages" + +# AppImage path +APPIMAGE_PATH="${PARENT_PATH}/epic-games-launcher-latest.appimage" + +# Icon path +ICON_PATH="${HOME}/.local/share/icons/epic-games-launcher.png" + +# Prep parent folder +if [[ ! -d "${PARENT_PATH}" ]]; then + mkdir -p "${PARENT_PATH}" +fi +mkdir -p "$(dirname "${ICON_PATH}")" + +URL="https://launcher-public-service-prod06.ol.epicgames.com/launcher/api/installer/download/EpicGamesLauncher-x86_64.AppImage" + +# Install Epic Games Launcher +sudo curl -L -o "${APPIMAGE_PATH}" "${URL}" + +# Set permissions +sudo chown "${USER}:${USER}" "${APPIMAGE_PATH}" +sudo chmod 755 "${APPIMAGE_PATH}" + +TEMP_DIR=$(mktemp -d) || exit 1 +trap 'rm -rf "${TEMP_DIR}"' EXIT +if ! ( + cd "${TEMP_DIR}" || exit + "${APPIMAGE_PATH}" --appimage-extract >/dev/null +); then + printf 'Failed to extract Epic Games Launcher icon from %s\n' "${APPIMAGE_PATH}" >&2 + exit 1 +fi +EXTRACTED_ICON="${TEMP_DIR}/squashfs-root/epic-games-launcher.png" +if [[ ! -f "${EXTRACTED_ICON}" ]]; then + printf 'Epic Games Launcher icon was not found in %s\n' "${APPIMAGE_PATH}" >&2 + exit 1 +fi +if ! cp "${EXTRACTED_ICON}" "${ICON_PATH}"; then + printf 'Failed to install Epic Games Launcher icon to %s\n' "${ICON_PATH}" >&2 + exit 1 +fi + +APPLICATIONS_PATH="${HOME}/.local/share/applications" +mkdir -p "${APPLICATIONS_PATH}" +cat > "${APPLICATIONS_PATH}/epic-games-launcher.desktop" < "${APPLICATIONS_PATH}/xodus-nexus.desktop" < /dev/null && pwd ) "${SCRIPT_DIR}"/12-ascension.sh "${SCRIPT_DIR}"/13-wowup.sh "${SCRIPT_DIR}"/14-weakauras.sh +"${SCRIPT_DIR}"/15-epic-games-launcher.sh +"${SCRIPT_DIR}"/16-xodus-nexus.sh "${SCRIPT_DIR}"/20-exiled-exchange.sh