mirror of
https://github.com/QuasarApp/CQtDeployer.git
synced 2025-05-14 10:29:36 +00:00
56 lines
1.1 KiB
Bash
Executable File
56 lines
1.1 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
APPS=$BASH_ARRAY_APPLICATIONS
|
|
APPS_SHORTCUTS=$BASH_ARRAY_SHORTCUTS_APPLICATIONS
|
|
|
|
TARGET_DIR=/opt/$PREFIX/
|
|
|
|
#creating shortcut
|
|
DEST_FILE=
|
|
DEST_NAME=
|
|
SRC_FILE=
|
|
function createShortCut {
|
|
|
|
echo "create shortCut"
|
|
rm -f $DEST_FILE
|
|
touch $DEST_FILE
|
|
|
|
if test -f $DEST_FILE; then
|
|
echo "[Desktop Entry]" >> $DEST_FILE
|
|
echo "Version=$VERSION" >> $DEST_FILE
|
|
echo "Encoding=UTF-8" >> $DEST_FILE
|
|
echo "Name=$DEST_NAME" >> $DEST_FILE
|
|
echo "Type=Application" >> $DEST_FILE
|
|
echo "Icon=/opt/$ICON" >> $DEST_FILE
|
|
echo "Terminal=false" >> $DEST_FILE
|
|
echo "Exec=$SRC_FILE" >> $DEST_FILE
|
|
|
|
chmod 775 $DEST_FILE
|
|
fi
|
|
}
|
|
|
|
echo "Available commands:"
|
|
|
|
for app in "${APPS[@]}"
|
|
do
|
|
|
|
DEST_NAME=$app
|
|
|
|
if [ ! -e /usr/bin/"${app,,}" ]; then
|
|
ln -s "$TARGET_DIR/$app.sh" /usr/bin/"${app,,}"
|
|
echo "${app,,}"
|
|
fi
|
|
done
|
|
|
|
for app in "${APPS_SHORTCUTS[@]}"
|
|
do
|
|
|
|
DEST_NAME=$app
|
|
|
|
SRC_FILE="$TARGET_DIR/$app"
|
|
DEST_FILE="/usr/share/applications/${app%.*}.desktop"
|
|
createShortCut
|
|
done
|
|
|
|
|