Godot Editor CLI arg to override WM_CLASS (so Linux users can de-group different executable versions) #12431
Replies: 3 comments
-
For the reference, Linux display server implementations set it to hardcoded value for the editor: But equivalent Windows implementation append engine version: |
Beta Was this translation helpful? Give feedback.
-
Wouldn't this be better as an environment variable rather than a CLI argument? Environment variables are easier to apply in a persistent manner on a system. (This would not be a concern if Godot supported appending CLI arguments from an environment variable's contents or reading a |
Beta Was this translation helpful? Give feedback.
-
I didn't realize WM_CLASS functions something like a comma delimited string at the time I created this discussion, but after using Indeed, if something like |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am running Ubuntu 24.04.1 LTS and have Godot 3.x LTS projects as well as Godot 4.x Latest projects. I prefer to use the direct executables downloadable from the Godot website, such as
Godot_v3.6-stable_x11.64
andGodot_v4.4.1-stable_linux.x86_64
I created .desktop files for each executable in
/home/{user}/.local/share/applications/
hoping to assign them two different icons and icon groups so I can run them at the same time without having them collapse into one another in my GNOME taskbar. The problem however is that it seems I must specifyStartupWMClass=Godot
to actually get it to resolve the desktop file configuration and be recognized as its own app by the OS. Since I have to specify the same StartupWMClass it seems there's no way I can accomplish separating different Godot versions/exectables to be treated separately by Ubuntu. I suspect this is because the Godot WM_CLASS is hard-coded in Godot Engine's source code.It'd be great if I could launch the Godot executable and pass a CLI argument such as
--class
to override its default WM_CLASS. I believe I could then do something like the below to make Ubuntu separate Godot v3.x from Godot v4.xEXAMPLE FILE: /home/{user}/.local/share/application/Godot4.desktop
[Desktop Entry]
Version=4.4
Name=Godot Engine
GenericName=Libre game engine
Comment=Multi-platform 2D and 3D game engine with a feature-rich editor
Exec=/home/{user}/Apps/Godot_v4.4.1-stable_linux.x86_64 --class=Godot4
Icon=/home/{user}/.local/share/icons/hicolor/256x256/apps/godot4.png
Terminal=false
Type=Application
MimeType=application/x-godot-project;
Categories=Development;IDE;
StartupWMClass=Godot4
EXAMPLE FILE: /home/{user}/.local/share/application/Godot3.desktop
[Desktop Entry]
Version=3.6
Name=Godot Engine
GenericName=Libre game engine
Comment=Multi-platform 2D and 3D game engine with a feature-rich editor
Exec=/home/{user}/Apps/Godot_v4.4.1-stable_linux.x86_64 --class=Godot3
Icon=/home/{user}/.local/share/icons/hicolor/256x256/apps/godot3.png
Terminal=false
Type=Application
MimeType=application/x-godot-project;
Categories=Development;IDE;
StartupWMClass=Godot3
Alternatively, if there's a reason the CLI argument to override WM_CLASS is not viable, I would also be happy if the hardcoded WM_CLASS that ships with Godot was changed between major versions, as I imagine other Linux Godot users jumping between 3.x LTS projects and 4.x projects would appreciate as well.
Beta Was this translation helpful? Give feedback.
All reactions