From d66953d3ac08fb37b1bce12b3ac034d8246f38c2 Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Sun, 23 Apr 2023 17:23:21 +0200 Subject: [PATCH] Add a bash script to generate a desktop launcher --- setup/appimage_launcher.sh | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100755 setup/appimage_launcher.sh diff --git a/setup/appimage_launcher.sh b/setup/appimage_launcher.sh new file mode 100755 index 00000000..fc0aa9e9 --- /dev/null +++ b/setup/appimage_launcher.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +if [ -z "$1" ]; then + echo "Please provide the path to the novelWriter.AppImage file as an argument" + exit 1 +fi + +if [ ! -e "$1" ]; then + echo "File not found" + exit 1 +fi + +IMGPATH="$(readlink -m "$1")" +echo "AppImage: $IMGPATH" + +ICONPATH="$(dirname "$IMGPATH")/novelWriter.png" + +if [ ! -e "$ICONPATH" ]; then + echo "Downloading icon" + wget https://raw.githubusercontent.com/vkbo/novelWriter/main/setup/data/hicolor/256x256/apps/novelwriter.png -O "$ICONPATH" +fi + +cat > $HOME/.local/share/applications/novelWriter.desktop <