atrooney-online-2/scripts/APPIMAGE_INSTALL.sh
lambdcalculus ef1a8ddb92
More Linux integration (#1085)
* 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!

* linux CI tweaks

* remove the need for `launch.sh`
* add git hash as appimage version
* bit of reorganization

* 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

* include icon in linux install

* fix install script

and fix typo

* add exec path to desktop files

* why would freedesktop.org do this to me

---------

Co-authored-by: OrioleNix <163466443+OrioleNix@users.noreply.github.com>
2025-03-17 10:32:11 +01:00

33 lines
843 B
Bash

#!/bin/bash
# exit on error
set -e
# 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
# 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=\"$escaped_exec\"
Icon=$(pwd)/icon.png"
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