Skip to content

Commit ef1a8dd

Browse files
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>
1 parent c0c278e commit ef1a8dd

5 files changed

Lines changed: 78 additions & 16 deletions

File tree

.github/workflows/build.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -187,13 +187,16 @@ jobs:
187187
cd ${{ github.workspace }}/bin
188188
mkdir ./imageformats
189189
cp ../qtapng/plugins/imageformats/libqapng.so ./imageformats
190-
cp ../scripts/launch.sh .
190+
cp ../data/logo-client.png ./icon.png
191191
cp ../README_LINUX.md .
192-
chmod +x launch.sh
192+
cp ../scripts/DYNAMIC_INSTALL.sh ./INSTALL.sh
193+
chmod +x INSTALL.sh
193194
chmod +x Attorney_Online
194195
196+
patchelf --add-rpath . Attorney_Online
197+
195198
cd ..
196-
tar --transform='flags=r;s|bin|Attorney_Online|' -cvf Attorney_Online-Dynamic.tar bin
199+
tar --transform='flags=r;s|bin|Attorney Online|' -cvf Attorney_Online-Dynamic.tar bin
197200
198201
- name: Create AppImage
199202
shell: bash
@@ -214,17 +217,23 @@ jobs:
214217
cp scripts/Attorney_Online.desktop AppDir/usr/share/applications
215218
cp data/logo-client.png AppDir/Attorney_Online.png
216219
220+
GIT_SHORT_SHA="${GITHUB_SHA::8}"
217221
QTDIR=${QT_ROOT_DIR} ./appimagetool deploy AppDir/usr/share/applications/Attorney_Online.desktop
218-
ARCH=x86_64 VERSION=2.11 ./appimagetool AppDir
222+
ARCH=x86_64 VERSION=${GIT_SHORT_SHA} ./appimagetool AppDir
219223
224+
- name: Deploy AppImage
225+
shell: bash
226+
run: |
220227
mkdir bin-appimage
221228
cp -r bin/base bin-appimage
229+
cp data/logo-client.png bin-appimage/icon.png
222230
cp README_LINUX.md bin-appimage
231+
cp scripts/APPIMAGE_INSTALL.sh bin-appimage/INSTALL.sh
223232
cp Attorney_Online-*-x86_64.AppImage bin-appimage
233+
chmod +x bin-appimage/INSTALL.sh
224234
chmod +x bin-appimage/Attorney_Online-*-x86_64.AppImage
225235
226-
tar -cvf Attorney_Online-AppImage.tar bin-appimage/*
227-
tar --transform='flags=r;s|bin-appimage|Attorney_Online|' -cvf Attorney_Online-AppImage.tar bin-appimage
236+
tar --transform='flags=r;s|bin-appimage|Attorney Online|' -cvf Attorney_Online-AppImage.tar bin-appimage
228237
229238
- name: Upload Dynamic Artifact
230239
uses: actions/upload-artifact@master

README_LINUX.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
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).
44

5+
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.
6+
57
### AppImage
68

79
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).

scripts/APPIMAGE_INSTALL.sh

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/bin/bash
2+
3+
# exit on error
4+
set -e
5+
6+
# Move to script's directory
7+
SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
8+
cd "${SCRIPT_DIR}"
9+
10+
#add .desktop file (which should allow most DE's easy access to the program
11+
mkdir -p ~/.local/share/applications
12+
13+
# desktop files don't like spaces in the Exec field, we have to replace them with "\s"
14+
appimage="$(echo Attorney_Online-*-x86_64.AppImage)"
15+
escaped_exec="$(echo "$(pwd)" | sed 's/ /\\s/g')"/"$appimage"
16+
17+
desktop_file="\
18+
[Desktop Entry]
19+
Type=Application
20+
Name=Attorney Online
21+
Comment=The courtroom drama simulator
22+
Path=$(pwd)
23+
Exec=\"$escaped_exec\"
24+
Icon=$(pwd)/icon.png"
25+
26+
echo "$desktop_file" > ~/.local/share/applications/'Attorney Online'.desktop
27+
28+
#marking the program as executable
29+
chmod +x Attorney_Online-*-x86_64.AppImage
30+
31+
#running the executable
32+
./Attorney_Online-*-x86_64.AppImage

scripts/DYNAMIC_INSTALL.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/bash
2+
3+
# exit on error
4+
set -e
5+
6+
# Move to script's directory
7+
SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
8+
cd "${SCRIPT_DIR}"
9+
10+
#add .desktop file (which should allow most DE's easy access to the program
11+
mkdir -p ~/.local/share/applications
12+
13+
# desktop files don't like spaces in the Exec field, we have to replace them with "\s"
14+
escaped_exec="$(echo "$(pwd)" | sed 's/ /\\s/g')"/Attorney_Online
15+
16+
desktop_file="\
17+
[Desktop Entry]
18+
Type=Application
19+
Name=Attorney Online
20+
Comment=The courtroom drama simulator
21+
Path=$(pwd)
22+
Exec=\"$escaped_exec\"
23+
Icon=$(pwd)/icon.png"
24+
25+
echo "$desktop_file" > ~/.local/share/applications/'Attorney Online'.desktop
26+
27+
#running the program
28+
chmod +x Attorney_Online
29+
./Attorney_Online

scripts/launch.sh

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)