Skip to content

Conversation

@reisaraujo-miguel
Copy link

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.

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.
@MakovWait
Copy link
Owner

Yes please, only related code. Thanks!

@reisaraujo-miguel
Copy link
Author

Done.

@MakovWait
Copy link
Owner

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?

@reisaraujo-miguel
Copy link
Author

reisaraujo-miguel commented Apr 1, 2025

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?

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.

@reisaraujo-miguel reisaraujo-miguel changed the title Feat: desktop integration Feat: Linux Installation Script Apr 1, 2025
@novadragonDOTspace
Copy link

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.
@reisaraujo-miguel
Copy link
Author

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 zipfile. I think most systems would have it installed, since python is widely used as a dependency for a lot of apps. But if neither python3 nor unzip is installed, the script will now error and ask the user to install it, it does the same for downloading if neither wget nor curl is available.

@novadragonDOTspace
Copy link

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.

@reisaraujo-miguel
Copy link
Author

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

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"

Copy link
Owner

Choose a reason for hiding this comment

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

shasum check should be added
sha256 may be fetched from digest property at https://api.github.com/repos/{owner}/{repo}/releases source

also I added SHA512-SUMS.txt to the latest workflow example

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

@zibetnu zibetnu Sep 19, 2025

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.

@reisaraujo-miguel
Copy link
Author

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.

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.

4 participants