From 639881b0f264dcfb83419077973292152425c002 Mon Sep 17 00:00:00 2001 From: OrioleNix <163466443+OrioleNix@users.noreply.github.com> Date: Sun, 9 Feb 2025 01:57:58 -0500 Subject: [PATCH 1/7] Add integration shell scripts for linux! These shell scripts (one for appimage and one for dynamic) both should: 1: Move the program files to ~/.local/Attorney_Online 2: Create a .desktop file (which is what applications on Linux use to know to be interacted with) in the ~/.local/share/applications folder (where all other user applications tend to go), with at current a temporary logo until the logo file is parsed out from the xapplication window. 3: open the application, assuming the necessary dependencies are fulfilled Dynamic required some further support due to the startup shell command working correctly when you click it manually, but struggling on the .desktop folder, so it has the additional step of recreating the current launch.sh command, which still functions if you go to the folder to click it, or if you open the program before integration to test things. Both sh commands open AO2-Client at completion time. I hope this will help newer Linux users, or older Linux users who normally wouldn't bother, to bring AO into their normal day to day experience. This has been tested on (by me): Fedora 40 Workstation (Gnome) Arch Linux KDE Plasma 6 Ubuntu Unity 24.10 aka Oracular Oriole Debian 13 Trixie (Before it's freeze, marking date February 9th 2025) Thank you for reading, have a wonderful day! --- scripts/appimage_integrator.sh | 23 +++++++++++++++++++++++ scripts/dynamic_integrator.sh | 26 ++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 scripts/appimage_integrator.sh create mode 100644 scripts/dynamic_integrator.sh diff --git a/scripts/appimage_integrator.sh b/scripts/appimage_integrator.sh new file mode 100644 index 000000000..db7cceee3 --- /dev/null +++ b/scripts/appimage_integrator.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# Required to launch correctly +#please note that this is the APPIMAGE version of this bash script, they are not cross compatible, and one will not work for the other + +# Move to AO's directory +SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) +cd "${SCRIPT_DIR}" + +#put into user's local library +mkdir ~/.local/Attorney_Online +mv -f {.*,*} ~/.local/Attorney_Online + +#add .desktop file (which should allow most DE's easy access to the program +mkdir ~/.local/share/applications +rm ~/.local/share/applications/'Attorney Online'.desktop +touch ~/.local/share/applications/'Attorney Online'.desktop +#please note that the best way forward here is to have the real logo in path, but this is a temporary logo, easily replaceable. +printf "[Desktop Entry]\nType=Application\nName=Attorney Online\nComment=The courtroom drama simulator\nExec=$(realpath ~/.local/Attorney_Online/Attorney_Online-*-x86_64.AppImage)\nIcon=$(realpath ~/.local/Attorney_Online)/base/themes/AOHD/placeholder.webp\nCategories=Game;" >> ~/.local/share/applications/'Attorney Online'.desktop + +#marking the program as executable +chmod +x ~/.local/Attorney_Online/Attorney_Online-*-x86_64.AppImage +#running the executable +~/.local/Attorney_Online/Attorney_Online-*-x86_64.AppImage diff --git a/scripts/dynamic_integrator.sh b/scripts/dynamic_integrator.sh new file mode 100644 index 000000000..c8a427c79 --- /dev/null +++ b/scripts/dynamic_integrator.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# Required to launch correctly + +# Move to AO's directory +SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) +cd "${SCRIPT_DIR}" + +#put into user's local library +mkdir ~/.local/Attorney_Online +mv -fu {.*,*} ~/.local/Attorney_Online + +#add .desktop file (which should allow most DE's easy access to the program +mkdir ~/.local/share/applications +rm ~/.local/share/applications/'Attorney Online'.desktop +touch ~/.local/share/applications/'Attorney Online'.desktop +#please note that the best way forward here is to have the real logo in path, but this is a temporary logo, easily replaceable. +printf "[Desktop Entry]\nType=Application\nName=Attorney Online\nComment=The courtroom drama simulator\nExec=$(realpath ~/.local/Attorney_Online)/launch.sh\nIcon=$(realpath ~/.local/Attorney_Online)/base/themes/AOHD/placeholder.webp\nCategories=Game;" >> ~/.local/share/applications/'Attorney Online'.desktop + +#making the launch.sh (probably not necessary, but if we removed launch.sh and replaced it with this, it makes the path clear without any mud from installing) +rm ~/.local/Attorney_Online/launch.sh +touch ~/.local/Attorney_Online/launch.sh +printf "#!/bin/bash\ncd $(realpath ~/.local/Attorney_Online)\nchmod +x $(realpath ~/.local/Attorney_Online/Attorney_Online)\nLD_LIBRARY_PATH=. $(realpath ~/.local/Attorney_Online/Attorney_Online)" >> ~/.local/Attorney_Online/launch.sh + +#running the program +chmod +x ~/.local/Attorney_Online/launch.sh +~/.local/Attorney_Online/launch.sh From 3a4ad1d4c436ec9048e54c4f43f8fc0243e382f5 Mon Sep 17 00:00:00 2001 From: lambdcalculus Date: Sun, 23 Feb 2025 16:43:46 -0300 Subject: [PATCH 2/7] linux CI tweaks * remove the need for `launch.sh` * add git hash as appimage version * bit of reorganization --- .github/workflows/build.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e4589b4eb..a2cafc2c5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -187,13 +187,13 @@ jobs: cd ${{ github.workspace }}/bin mkdir ./imageformats cp ../qtapng/plugins/imageformats/libqapng.so ./imageformats - cp ../scripts/launch.sh . cp ../README_LINUX.md . - chmod +x launch.sh chmod +x Attorney_Online + patchelf --add-rpath . Attorney_Online + cd .. - tar --transform='flags=r;s|bin|Attorney_Online|' -cvf Attorney_Online-Dynamic.tar bin + tar --transform='flags=r;s|bin|Attorney Online|' -cvf Attorney_Online-Dynamic.tar bin - name: Create AppImage shell: bash @@ -214,17 +214,20 @@ jobs: cp scripts/Attorney_Online.desktop AppDir/usr/share/applications cp data/logo-client.png AppDir/Attorney_Online.png + GIT_SHORT_SHA="${GITHUB_SHA::8}" QTDIR=${QT_ROOT_DIR} ./appimagetool deploy AppDir/usr/share/applications/Attorney_Online.desktop - ARCH=x86_64 VERSION=2.11 ./appimagetool AppDir + ARCH=x86_64 VERSION=${GIT_SHORT_SHA} ./appimagetool AppDir + - name: Deploy AppImage + shell: bash + run: | mkdir bin-appimage cp -r bin/base bin-appimage cp README_LINUX.md bin-appimage cp Attorney_Online-*-x86_64.AppImage bin-appimage chmod +x bin-appimage/Attorney_Online-*-x86_64.AppImage - tar -cvf Attorney_Online-AppImage.tar bin-appimage/* - tar --transform='flags=r;s|bin-appimage|Attorney_Online|' -cvf Attorney_Online-AppImage.tar bin-appimage + tar --transform='flags=r;s|bin-appimage|Attorney Online|' -cvf Attorney_Online-AppImage.tar bin-appimage - name: Upload Dynamic Artifact uses: actions/upload-artifact@master From 2f188153aed7d592b4183120297590609ee376da Mon Sep 17 00:00:00 2001 From: lambdcalculus Date: Sun, 23 Feb 2025 17:06:24 -0300 Subject: [PATCH 3/7] add linux install scripts to CI * tweak linux install scripts to add install scripts * remove `launch.sh` (as per previous commit) * add instructions in README_LINUX --- .github/workflows/build.yml | 4 ++++ README_LINUX.md | 2 ++ scripts/APPIMAGE_INSTALL.sh | 24 ++++++++++++++++++++++++ scripts/DYNAMIC_INSTALL.sh | 22 ++++++++++++++++++++++ scripts/appimage_integrator.sh | 23 ----------------------- scripts/dynamic_integrator.sh | 26 -------------------------- scripts/launch.sh | 10 ---------- 7 files changed, 52 insertions(+), 59 deletions(-) create mode 100644 scripts/APPIMAGE_INSTALL.sh create mode 100644 scripts/DYNAMIC_INSTALL.sh delete mode 100644 scripts/appimage_integrator.sh delete mode 100644 scripts/dynamic_integrator.sh delete mode 100644 scripts/launch.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a2cafc2c5..11a004cc8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -188,6 +188,8 @@ jobs: mkdir ./imageformats cp ../qtapng/plugins/imageformats/libqapng.so ./imageformats cp ../README_LINUX.md . + cp ../scripts/DYNAMIC_INSTALL.sh ./INSTALL.sh + chmod +x INSTALL.sh chmod +x Attorney_Online patchelf --add-rpath . Attorney_Online @@ -224,7 +226,9 @@ jobs: mkdir bin-appimage cp -r bin/base bin-appimage cp README_LINUX.md bin-appimage + cp scripts/APPIMAGE_INSTALL.sh bin-appimage/INSTALL.sh cp Attorney_Online-*-x86_64.AppImage bin-appimage + chmod +x bin-appimage/INSTALL.sh chmod +x bin-appimage/Attorney_Online-*-x86_64.AppImage tar --transform='flags=r;s|bin-appimage|Attorney Online|' -cvf Attorney_Online-AppImage.tar bin-appimage diff --git a/README_LINUX.md b/README_LINUX.md index ceabf14c7..eb14e1530 100644 --- a/README_LINUX.md +++ b/README_LINUX.md @@ -2,6 +2,8 @@ There are two download options for running on Linux: the **dynamically-linked** build and the **AppImage**. The dynamic build is lighter, but might only run on newer systems. The AppImage is a bit bigger, but should run seamlessly on most systems (anything newer than Ubuntu 22.04 LTS). +Each version also accompanies an `INSTALL.sh` script that will create a desktop for file for AO pointing to where the script was ran. This will enable you to run AO from an app launcher. Note that moving AO's folder will require running this script again. + ### AppImage If you downloaded the **AppImage** version, it should just be plug-and-play. If you run into errors or bugs, contact us in our [Discord server](https://discord.gg/wWvQ3pw) or open an [issue on GitHub](https://github.com/AttorneyOnline/AO2-Client/issues). diff --git a/scripts/APPIMAGE_INSTALL.sh b/scripts/APPIMAGE_INSTALL.sh new file mode 100644 index 000000000..e1d4dcd35 --- /dev/null +++ b/scripts/APPIMAGE_INSTALL.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +# Move to script's directory +SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) +cd "${SCRIPT_DIR}" + +#add .desktop file (which should allow most DE's easy access to the program +mkdir -p ~/.local/share/applications +#please note that the best way forward here is to have the real logo in path, but this is a temporary logo, easily replaceable. +desktop_file=" +[Desktop Entry] +Type=Application +Name=Attorney Online +Comment=The courtroom drama simulator +Exec=$(realpath $(pwd)/Attorney_Online-*-x86_64.AppImage) +Icon=$(pwd)/base/themes/AOHD/placeholder.webp" + +echo "$desktop_file" > ~/.local/share/applications/'Attorney Online'.desktop + +#marking the program as executable +chmod +x Attorney_Online-*-x86_64.AppImage + +#running the executable +./Attorney_Online-*-x86_64.AppImage diff --git a/scripts/DYNAMIC_INSTALL.sh b/scripts/DYNAMIC_INSTALL.sh new file mode 100644 index 000000000..ecffa9e5d --- /dev/null +++ b/scripts/DYNAMIC_INSTALL.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +# Move to script's directory +SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) +cd "${SCRIPT_DIR}" + +#add .desktop file (which should allow most DE's easy access to the program +mkdir -p ~/.local/share/applications +#please note that the best way forward here is to have the real logo in path, but this is a temporary logo, easily replaceable. +desktop_file=" +[Desktop Entry] +Type=Application +Name=Attorney Online +Comment=The courtroom drama simulator +Exec=$(realpath $(pwd)/Attorney_Online) +Icon=$(pwd)/base/themes/AOHD/placeholder.webp" + +echo "$desktop_file" > ~/.local/share/applications/'Attorney Online'.desktop + +#running the program +chmod +x Attorney_Online +./Attorney_Online diff --git a/scripts/appimage_integrator.sh b/scripts/appimage_integrator.sh deleted file mode 100644 index db7cceee3..000000000 --- a/scripts/appimage_integrator.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -# Required to launch correctly -#please note that this is the APPIMAGE version of this bash script, they are not cross compatible, and one will not work for the other - -# Move to AO's directory -SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) -cd "${SCRIPT_DIR}" - -#put into user's local library -mkdir ~/.local/Attorney_Online -mv -f {.*,*} ~/.local/Attorney_Online - -#add .desktop file (which should allow most DE's easy access to the program -mkdir ~/.local/share/applications -rm ~/.local/share/applications/'Attorney Online'.desktop -touch ~/.local/share/applications/'Attorney Online'.desktop -#please note that the best way forward here is to have the real logo in path, but this is a temporary logo, easily replaceable. -printf "[Desktop Entry]\nType=Application\nName=Attorney Online\nComment=The courtroom drama simulator\nExec=$(realpath ~/.local/Attorney_Online/Attorney_Online-*-x86_64.AppImage)\nIcon=$(realpath ~/.local/Attorney_Online)/base/themes/AOHD/placeholder.webp\nCategories=Game;" >> ~/.local/share/applications/'Attorney Online'.desktop - -#marking the program as executable -chmod +x ~/.local/Attorney_Online/Attorney_Online-*-x86_64.AppImage -#running the executable -~/.local/Attorney_Online/Attorney_Online-*-x86_64.AppImage diff --git a/scripts/dynamic_integrator.sh b/scripts/dynamic_integrator.sh deleted file mode 100644 index c8a427c79..000000000 --- a/scripts/dynamic_integrator.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash -# Required to launch correctly - -# Move to AO's directory -SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) -cd "${SCRIPT_DIR}" - -#put into user's local library -mkdir ~/.local/Attorney_Online -mv -fu {.*,*} ~/.local/Attorney_Online - -#add .desktop file (which should allow most DE's easy access to the program -mkdir ~/.local/share/applications -rm ~/.local/share/applications/'Attorney Online'.desktop -touch ~/.local/share/applications/'Attorney Online'.desktop -#please note that the best way forward here is to have the real logo in path, but this is a temporary logo, easily replaceable. -printf "[Desktop Entry]\nType=Application\nName=Attorney Online\nComment=The courtroom drama simulator\nExec=$(realpath ~/.local/Attorney_Online)/launch.sh\nIcon=$(realpath ~/.local/Attorney_Online)/base/themes/AOHD/placeholder.webp\nCategories=Game;" >> ~/.local/share/applications/'Attorney Online'.desktop - -#making the launch.sh (probably not necessary, but if we removed launch.sh and replaced it with this, it makes the path clear without any mud from installing) -rm ~/.local/Attorney_Online/launch.sh -touch ~/.local/Attorney_Online/launch.sh -printf "#!/bin/bash\ncd $(realpath ~/.local/Attorney_Online)\nchmod +x $(realpath ~/.local/Attorney_Online/Attorney_Online)\nLD_LIBRARY_PATH=. $(realpath ~/.local/Attorney_Online/Attorney_Online)" >> ~/.local/Attorney_Online/launch.sh - -#running the program -chmod +x ~/.local/Attorney_Online/launch.sh -~/.local/Attorney_Online/launch.sh diff --git a/scripts/launch.sh b/scripts/launch.sh deleted file mode 100644 index bdae56d4d..000000000 --- a/scripts/launch.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -# Required to launch correctly - -# Move to AO's directory -SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) -cd "${SCRIPT_DIR}" - -# Run with correct linker path -chmod +x Attorney_Online -LD_LIBRARY_PATH=. ./Attorney_Online From be9829578bbe8877e55a8195dfd00434c05dd991 Mon Sep 17 00:00:00 2001 From: lambdcalculus Date: Tue, 25 Feb 2025 16:09:36 -0300 Subject: [PATCH 4/7] include icon in linux install --- .github/workflows/build.yml | 2 ++ scripts/APPIMAGE_INSTALL.sh | 4 ++-- scripts/DYNAMIC_INSTALL.sh | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 11a004cc8..031cd4fa4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -187,6 +187,7 @@ jobs: cd ${{ github.workspace }}/bin mkdir ./imageformats cp ../qtapng/plugins/imageformats/libqapng.so ./imageformats + cp ../data/logo-client.png ./icon.png cp ../README_LINUX.md . cp ../scripts/DYNAMIC_INSTALL.sh ./INSTALL.sh chmod +x INSTALL.sh @@ -225,6 +226,7 @@ jobs: run: | mkdir bin-appimage cp -r bin/base bin-appimage + cp data/logo-client.png bin-appimage/icon.png cp README_LINUX.md bin-appimage cp scripts/APPIMAGE_INSTALL.sh bin-appimage/INSTALL.sh cp Attorney_Online-*-x86_64.AppImage bin-appimage diff --git a/scripts/APPIMAGE_INSTALL.sh b/scripts/APPIMAGE_INSTALL.sh index e1d4dcd35..a7e50b0a2 100644 --- a/scripts/APPIMAGE_INSTALL.sh +++ b/scripts/APPIMAGE_INSTALL.sh @@ -6,14 +6,14 @@ cd "${SCRIPT_DIR}" #add .desktop file (which should allow most DE's easy access to the program mkdir -p ~/.local/share/applications -#please note that the best way forward here is to have the real logo in path, but this is a temporary logo, easily replaceable. + desktop_file=" [Desktop Entry] Type=Application Name=Attorney Online Comment=The courtroom drama simulator Exec=$(realpath $(pwd)/Attorney_Online-*-x86_64.AppImage) -Icon=$(pwd)/base/themes/AOHD/placeholder.webp" +Icon=$(pwd)/icon.png" echo "$desktop_file" > ~/.local/share/applications/'Attorney Online'.desktop diff --git a/scripts/DYNAMIC_INSTALL.sh b/scripts/DYNAMIC_INSTALL.sh index ecffa9e5d..1c55f876c 100644 --- a/scripts/DYNAMIC_INSTALL.sh +++ b/scripts/DYNAMIC_INSTALL.sh @@ -6,14 +6,14 @@ cd "${SCRIPT_DIR}" #add .desktop file (which should allow most DE's easy access to the program mkdir -p ~/.local/share/applications -#please note that the best way forward here is to have the real logo in path, but this is a temporary logo, easily replaceable. + desktop_file=" [Desktop Entry] Type=Application Name=Attorney Online Comment=The courtroom drama simulator Exec=$(realpath $(pwd)/Attorney_Online) -Icon=$(pwd)/base/themes/AOHD/placeholder.webp" +Icon=$(pwd)/icon.png" echo "$desktop_file" > ~/.local/share/applications/'Attorney Online'.desktop From c05f6ad8bec496169443c89a8fa7d2b57781138b Mon Sep 17 00:00:00 2001 From: lambdcalculus Date: Tue, 25 Feb 2025 16:24:16 -0300 Subject: [PATCH 5/7] fix install script and fix typo --- README_LINUX.md | 2 +- scripts/APPIMAGE_INSTALL.sh | 2 +- scripts/DYNAMIC_INSTALL.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README_LINUX.md b/README_LINUX.md index eb14e1530..146799b3e 100644 --- a/README_LINUX.md +++ b/README_LINUX.md @@ -2,7 +2,7 @@ There are two download options for running on Linux: the **dynamically-linked** build and the **AppImage**. The dynamic build is lighter, but might only run on newer systems. The AppImage is a bit bigger, but should run seamlessly on most systems (anything newer than Ubuntu 22.04 LTS). -Each version also accompanies an `INSTALL.sh` script that will create a desktop for file for AO pointing to where the script was ran. This will enable you to run AO from an app launcher. Note that moving AO's folder will require running this script again. +Each version also accompanies an `INSTALL.sh` script that will create a desktop file for AO pointing to where the script was ran. This will enable you to run AO from an app launcher. Note that moving AO's folder will require running this script again. ### AppImage diff --git a/scripts/APPIMAGE_INSTALL.sh b/scripts/APPIMAGE_INSTALL.sh index a7e50b0a2..fd8d7ca86 100644 --- a/scripts/APPIMAGE_INSTALL.sh +++ b/scripts/APPIMAGE_INSTALL.sh @@ -12,7 +12,7 @@ desktop_file=" Type=Application Name=Attorney Online Comment=The courtroom drama simulator -Exec=$(realpath $(pwd)/Attorney_Online-*-x86_64.AppImage) +Exec=$(realpath "$(pwd)"/Attorney_Online-*-x86_64.AppImage) Icon=$(pwd)/icon.png" echo "$desktop_file" > ~/.local/share/applications/'Attorney Online'.desktop diff --git a/scripts/DYNAMIC_INSTALL.sh b/scripts/DYNAMIC_INSTALL.sh index 1c55f876c..04f6e41c0 100644 --- a/scripts/DYNAMIC_INSTALL.sh +++ b/scripts/DYNAMIC_INSTALL.sh @@ -12,7 +12,7 @@ desktop_file=" Type=Application Name=Attorney Online Comment=The courtroom drama simulator -Exec=$(realpath $(pwd)/Attorney_Online) +Exec=$(pwd)/Attorney_Online Icon=$(pwd)/icon.png" echo "$desktop_file" > ~/.local/share/applications/'Attorney Online'.desktop From f573cdae0c35da73223bc5c07b94d7ba935d3fc4 Mon Sep 17 00:00:00 2001 From: lambdcalculus Date: Thu, 27 Feb 2025 10:23:45 -0300 Subject: [PATCH 6/7] add exec path to desktop files --- scripts/APPIMAGE_INSTALL.sh | 3 ++- scripts/DYNAMIC_INSTALL.sh | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/APPIMAGE_INSTALL.sh b/scripts/APPIMAGE_INSTALL.sh index fd8d7ca86..e17f416dc 100644 --- a/scripts/APPIMAGE_INSTALL.sh +++ b/scripts/APPIMAGE_INSTALL.sh @@ -7,11 +7,12 @@ cd "${SCRIPT_DIR}" #add .desktop file (which should allow most DE's easy access to the program mkdir -p ~/.local/share/applications -desktop_file=" +desktop_file="\ [Desktop Entry] Type=Application Name=Attorney Online Comment=The courtroom drama simulator +Path=$(pwd) Exec=$(realpath "$(pwd)"/Attorney_Online-*-x86_64.AppImage) Icon=$(pwd)/icon.png" diff --git a/scripts/DYNAMIC_INSTALL.sh b/scripts/DYNAMIC_INSTALL.sh index 04f6e41c0..7fe3a4c70 100644 --- a/scripts/DYNAMIC_INSTALL.sh +++ b/scripts/DYNAMIC_INSTALL.sh @@ -7,11 +7,12 @@ cd "${SCRIPT_DIR}" #add .desktop file (which should allow most DE's easy access to the program mkdir -p ~/.local/share/applications -desktop_file=" +desktop_file="\ [Desktop Entry] Type=Application Name=Attorney Online Comment=The courtroom drama simulator +Path=$(pwd) Exec=$(pwd)/Attorney_Online Icon=$(pwd)/icon.png" From 365ad2fd59c48792e8754f9cf4c01850747d53f1 Mon Sep 17 00:00:00 2001 From: lambdcalculus Date: Thu, 27 Feb 2025 11:14:28 -0300 Subject: [PATCH 7/7] why would freedesktop.org do this to me --- scripts/APPIMAGE_INSTALL.sh | 9 ++++++++- scripts/DYNAMIC_INSTALL.sh | 8 +++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/scripts/APPIMAGE_INSTALL.sh b/scripts/APPIMAGE_INSTALL.sh index e17f416dc..98eb538ff 100644 --- a/scripts/APPIMAGE_INSTALL.sh +++ b/scripts/APPIMAGE_INSTALL.sh @@ -1,5 +1,8 @@ #!/bin/bash +# exit on error +set -e + # Move to script's directory SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) cd "${SCRIPT_DIR}" @@ -7,13 +10,17 @@ cd "${SCRIPT_DIR}" #add .desktop file (which should allow most DE's easy access to the program mkdir -p ~/.local/share/applications +# desktop files don't like spaces in the Exec field, we have to replace them with "\s" +appimage="$(echo Attorney_Online-*-x86_64.AppImage)" +escaped_exec="$(echo "$(pwd)" | sed 's/ /\\s/g')"/"$appimage" + desktop_file="\ [Desktop Entry] Type=Application Name=Attorney Online Comment=The courtroom drama simulator Path=$(pwd) -Exec=$(realpath "$(pwd)"/Attorney_Online-*-x86_64.AppImage) +Exec=\"$escaped_exec\" Icon=$(pwd)/icon.png" echo "$desktop_file" > ~/.local/share/applications/'Attorney Online'.desktop diff --git a/scripts/DYNAMIC_INSTALL.sh b/scripts/DYNAMIC_INSTALL.sh index 7fe3a4c70..87b3715c9 100644 --- a/scripts/DYNAMIC_INSTALL.sh +++ b/scripts/DYNAMIC_INSTALL.sh @@ -1,5 +1,8 @@ #!/bin/bash +# exit on error +set -e + # Move to script's directory SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) cd "${SCRIPT_DIR}" @@ -7,13 +10,16 @@ cd "${SCRIPT_DIR}" #add .desktop file (which should allow most DE's easy access to the program mkdir -p ~/.local/share/applications +# desktop files don't like spaces in the Exec field, we have to replace them with "\s" +escaped_exec="$(echo "$(pwd)" | sed 's/ /\\s/g')"/Attorney_Online + desktop_file="\ [Desktop Entry] Type=Application Name=Attorney Online Comment=The courtroom drama simulator Path=$(pwd) -Exec=$(pwd)/Attorney_Online +Exec=\"$escaped_exec\" Icon=$(pwd)/icon.png" echo "$desktop_file" > ~/.local/share/applications/'Attorney Online'.desktop