Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add integration shell scripts for linux! #1082

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

OrioleNix
Copy link

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!

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!
@OrioleNix
Copy link
Author

To truly integrate, I would have to change the buildfile in two significant ways (to the best of my knowledge)
1: package the shell scripts in the folders
2: grab the logo from our git repository, and put that in the folder before zipping

Both are easy changes, with it being a simple copy command, (and in the case of the logo, changing less than a line) but I did not feel comfortable editing the buildfile until I saw there was interest in supporting ease of use, if you have any questions with the code audit, I can happily walk through every step, and if you know of improvements that can be made, I am more than happy to hear and test them!

Thank you.

Copy link
Member

@in1tiate in1tiate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't have very many Linux users, and even fewer Linux developers, so I can't pretend I know much about the Linux desktop environment. I don't think I understand what these scripts accomplish.


#put into user's local library
mkdir ~/.local/Attorney_Online
mv -fu {.*,*} ~/.local/Attorney_Online
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uh??? what are you trying to accomplish here, exactly? -f skips the prompt for overwriting files in the destination, but -u is the option for skipping files that already exist at the destination.

also, it's not clear what exactly {.*,*} is supposed to capture, and the use of such nonspecific wildcards here is pretty scary

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I apologize about the issue with the '-fu', '-f' should be sufficient. The reason for the {.*,*} is that it catches hidden files, any file with a . at the start of it's prefecture (such as the .gitignore in the dynamic library) will not be caught by simply doing 'mv * /example', this then clarifies to the system to check all files in this directory, first checking for any hidden files (which all start with a .), then checking for any remaining files. The purpose, aside from grabbing the .gitignore, is in case a user (for whatever reason) has a file or character named starting with a ., which would be left behind otherwise!

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-2.11-x86_64.AppImage)\nIcon=$(realpath ~/.local/Attorney_Online)/base/themes/AOHD/placeholder.webp\nCategories=Game;" >> ~/.local/share/applications/'Attorney Online'.desktop
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please don't hardcode the version number

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, correcting!

@@ -0,0 +1,23 @@
#!/bin/bash
# Required to launch correctly
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assuming you're referring to the shebang (#!/bin/bash) at the top of the script, that is required for all bash scripts and doesn't really need a comment

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was following the precursor script's lead in launch.sh, if it seems better fit to remove it, I see no issue in doing so!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That comment doesn't refer to the shebang, but rather what the script does. You can remove it or make it say what the integrator scripts do.

Removed the redundant 'u' in the move command, removed all direct versioning calls and replaced them with abstracts.
Copy link
Contributor

@lambdcalculus lambdcalculus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a good idea. I made my own desktop file to manage many AO installs but some users might appreciate just a quick install script. I've noted down some changes that make this a bit more flexible, but otherwise it looks good to me.

Once this is merged, I'll give a shot at integrating it into the CI.

(a minor nitpick is that i would probably name these appimage_install.sh and dynamic_install.sh instead but it's fine like this :p)

Comment on lines +9 to +11
#put into user's local library
mkdir ~/.local/Attorney_Online
mv -f {.*,*} ~/.local/Attorney_Online
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this bit is really necessary. I think we should probably do something similar to Project Ignis, where we create a desktop file pointing to wherever the user put the program folder in. Gives them a bit more freedom to decide where to put AO, which can be useful if you have multiple installs/base folders.

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Due to the above, the paths to the executable and icon would need to become

Exec=$(realpath $(pwd)/Attorney_Online-*-x86_64.AppImage)
Icon=$(pwd)/base/themes/AOHD/placeholder.webp

Comment on lines +20 to +23
#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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly, these bits would change to just point to the AppImage that is in the folder we're running this from.

Similar changes should be applied to the other file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants