Desktop files for Godot

Godotbot

I usually run a few different versions of Godot - the regular one for regular game dev, a dotnet one for developing Dialogue Manager, and (when there is one) whatever the next RC is for testing future compatibility.

Because I downloaded these files manually I also had to manually make .desktop files for them so that Gnome can see them in the launcher.

To easily make .desktop files I installed Main Menu.

There was a slight complication, though, in that Godot registers multiple window classes.

I found this out by opening Looking Glass, a utility built into Gnome:

  1. Press Alt+F2
  2. Run lg
  3. Click Windows at the top of the screen
  4. Look for the wm_class against the window you want to match
  5. Press Esc to close Looking Glass

Using that I could see the two window classes for Godot were org.godotengine.Editor and org.godotengine.ProjectManager so Gnome's window matcher was getting a bit confused between the Godot project launcher and a regular open project.

To fix this, I added a second, hidden .desktop file that matches the other window class.

Now Gnome had the proper icon no matter if the project launcher is showing or if I'm editing a project.

I also added file extension detection to the dotnet version so that I can quickly open example projects from Nautilus without polluting my project launcher. Main Menu didn't seem to have a way to add this so I had to edit the .desktop file manually and add a MimeType=application/x-godot-project; line.