Skip to content

Instantly share code, notes, and snippets.

@idlesign
Created June 1, 2023 13:04
Show Gist options
  • Save idlesign/9a625a53219eeb42474c16282b7a33e9 to your computer and use it in GitHub Desktop.
Save idlesign/9a625a53219eeb42474c16282b7a33e9 to your computer and use it in GitHub Desktop.
Create launcher for Audacity appImage
#! /usr/bin/env bash
read -p "This will create Audacity launcher for an appImage found nearby. Press Enter to begin."
echo Creating audacity/ directory ...
mkdir -p audacity/
echo Searching for Audacity appImage nearby ...
find ./ -maxdepth 1 -type f -name "audacity*.AppImage" -print0 | xargs -0 -I{} mv "{}" "audacity/audacity.AppImage"
cd audacity/
DIR_APP=$(pwd)
DIR_MODULES=$DIR_APP/modules
PATH_DESKTOP=~/.local/share/applications/audacity.desktop
echo Temporarily exract files from appImage to create launcher ...
./audacity.AppImage --appimage-extract
cp squashfs-root/share/applications/audacity.desktop $PATH_DESKTOP
cp squashfs-root/share/icons/hicolor/48x48/audacity.png ~/.local/share/icons/audacity.png
echo Fixing launcher ...
sed -i "s|audacity %F|env AUDACITY_MODULES_PATH=$DIR_MODULES $DIR_APP/audacity.AppImage|" $PATH_DESKTOP
echo Preparing modules directory ...
cp -r squashfs-root/lib/audacity/modules/ $DIR_MODULES
echo Removing temporary files ...
rm -rf squashfs-root/
echo Finished.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment