-
Notifications
You must be signed in to change notification settings - Fork 45
Feat: Linux Installation Script #122
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
base: main
Are you sure you want to change the base?
Feat: Linux Installation Script #122
Conversation
This commit adds desktop integration for linux by moving the executable to .local/godots.app and creating a desktop file in .local/share/applications. This way we can have a system shortcut to easily launch the application
The changes focus on adding proper type annotations and fixing various static typing issues throughout the codebase. The commit handles type safety improvements and GDScript best practices. I have also commented some unused or unreachable code, fixed narrowing conversion warnings by explicitly converting them, and added some annotations to ignore warnings from code I can't find a way to fix (for example, the await calls from some async functions. If I leave the await keyword, I get a warning saying it is redundant, but if I remove it, I get an error saying I have to add it... wtf) Also, we have some formatting because I have enabled gdformat to run automatically when I save a file. I think I will make a commit just with formatting to the rest of the files.
This reverts commit be959cc.
|
Yes please, only related code. Thanks! |
|
Done. |
|
Thanks! Now lets talk about the feature. I am not sure it is OK to have some sort of side effect during startup. I think this behavior should be triggered by the user, for instance via special button in Settings tab (near Setting Folder button or as a separate settings category) also, the button/category should be available for Linux users only what do you think? |
…ents" This reverts commit 41f28a6.
This reverts commit 05698c0.
This reverts commit be959cc.
This reverts commit a720bdb.
I think instead of adding a desktop file creation feature inside of the app, we could just add an installation script the user can execute. The same way bun, deno and kitty do.
This reverts commit ff6c952.
This reverts commit 61160dd.
…ents" This reverts commit 41f28a6.
This reverts commit 05698c0.
This reverts commit be959cc.
This reverts commit a720bdb.
I think you're right. I tried to look at the source code to understand how to add a toggle to the configuration popup to create the desktop file. But I couldn't really figure out how the UI is built, because of that I decide to go through another route. I added an installation script to the project and added instructions to the README on how to use it. That's the same way bun, deno and kitty do installation. |
|
Code needs to check if unzip is installed in the first place. Arch Linux as a major one doesnt default install it in the first place. |
This commit handles a few edge cases for downloading files and unzipping. I used the python3 method as the default for unzipping because I think most systems should have python installed, since it is a dependacy for a lot widely used applications. I also added some lines to update the desktop database after installing. This was added mostly because of my personal Hyprland configuration, where it doesn't do this automatically, although on most DE's like Gnome or Plasma doing this would be unnecessary.
|
Sorry for the long wait, I was busy with some stuff. I handled the cases for when unzip is not installed by using the python3 module |
|
the zip thing should prolly rather be resolve by #131 instead of still relying on unzip, so that line of code prolly would be undone anyways. And relying on python3 to be installed is like, the same issue. Also in general, like, install scripts for linux i feel are mostly discouraged in comparision to native packaging. |
|
I don't think using ZipReader would be possible since it is a Godot feature, so if you don't have Godot or Godots installed yet, you wouldn't be able to use it. You're right that native packages would be better, but if the user distro doesn't have a package for Godots, this would not be possible. Flatpak is great, but for "IDE's" or other development applications it is not a good option because of the limitations of sandboxing, |
install.sh
Outdated
| update-desktop-database -q | ||
| fi | ||
|
|
||
| if command -v gtk-upate-icon-cache &>/dev/null; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
upate -> should be update?
|
|
||
| printf "Downloading Godots...\n" | ||
| try_download "$GODOTS_DOWNLOAD_URL" "$GODOTS_TMP_DIR" | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
install.sh
Outdated
| GODOTS_DOWNLOAD_URL="https://github.com/MakovWait/godots/releases/latest/download/LinuxX11.zip" | ||
| GODOTS_TMP_DIR="/tmp/godots" | ||
|
|
||
| GODOTS_INSTALL_DIR="$HOME/.local/godots.app" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To throw in my 2 cents, what's up with this install directory? I think it would make more sense to default to $HOME/.local/share/godots but prefer $XDG_DATA_HOME/godots if that variable exists.
|
Hey! I just made some changes to the script following your suggestions, and also added some error handling to the commands in case they fail during the execution. |
Here is only the feature code. There are some changes Godot did to the export_presets.cfg and project.godot, but I can revert this before you merge if you find it better.