Created
December 17, 2024 09:35
-
-
Save gmolveau/a8afca3675cb68897aad00f26c0b9c14 to your computer and use it in GitHub Desktop.
Openshot appimage installer
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 -o errexit | |
set -o pipefail | |
set -o nounset | |
# set -o xtrace | |
APPIMAGE_URL="https://github.com/OpenShot/openshot-qt/releases/download/v3.2.1/OpenShot-v3.2.1-x86_64.AppImage" | |
APPIMAGE_NAME="OpenShot-v3.2.1-x86_64.AppImage" | |
ICON_SOURCE="squashfs-root/usr/share/icons/hicolor/scalable/apps/openshot-qt.svg" | |
ICON_DEST="/usr/share/icons/openshot/openshot-qt.svg" | |
DESKTOP_FILE="/usr/share/applications/openshot.desktop" | |
# Create necessary directories | |
sudo mkdir -p "$(dirname ${ICON_DEST})" | |
# Download the OpenShot AppImage | |
cd /tmp | |
wget -q "${APPIMAGE_URL}" -O "${APPIMAGE_NAME}" | |
# Extract the AppImage | |
chmod +x "${APPIMAGE_NAME}" | |
./${APPIMAGE_NAME} --appimage-extract | |
# Copy the SVG icon to the destination directory | |
sudo cp "${ICON_SOURCE}" "${ICON_DEST}" | |
# Move the AppImage to /usr/local/bin and make it executable | |
sudo mv "${APPIMAGE_NAME}" /usr/local/bin/openshot | |
sudo chmod +x /usr/local/bin/openshot | |
# Create the .desktop file | |
cat << EOF | sudo tee -a "${DESKTOP_FILE}" | |
[Desktop Entry] | |
Name=OpenShot Video Editor | |
Comment=OpenShot Video Editor | |
Exec=/usr/local/bin/openshot | |
Icon=${ICON_DEST} | |
Terminal=false | |
Type=Application | |
Categories=AudioVideo;Video; | |
EOF | |
# Make the .desktop file executable | |
sudo chmod +x "${DESKTOP_FILE}" | |
# Clean up | |
rm -rf squashfs-root | |
echo "OpenShot has been installed." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment