Start Linux Client with a double click

When you download the linux exec and you extract it into a folder a lot of ppl forget that you have to run the .sh script and not the executable.

Beyond that, if you are on Ubuntu like me, it’s a major chore that you that you have to basically whip up the terminal and run the sh script from there since Ubuntu by default doesnt allow you to run sh scripts anymore.

However there is a solution, we are going to create a proper Linux shortcut, its called a “desktop file”.
In your defold folder(for easy access), create a new file and name it ‘Defold Engine.desktop’.
Now open that file on your text editor and paste:

[Desktop Entry]
Name=Defold Engine
Comment=Run Defold Engine
Exec=/home/$user/$path/Defold-linux.sh
Icon=/home/$user/$path/icon.xpm
Terminal=false
Type=Application

Where $user is your user name and $path is where you extracted the content inside your home folder.
Assuming you extracted it inside your home folder that is. :smiley:

Now save the file, right click on it(under Ubuntu) and set its permission to executable.
There, now you have a proper shortcut and the icon will show up in the launcher also, fine and dandy.

Hope that helps!

7 Likes

This really should be a feature request.

Still, very helpful. Thanks, @Aiki!

1 Like

Awesome! (10 characters…)

1 Like

With editor 2, in order to have proper menu recognition and shortcuts, you can still use the same template.

[Desktop Entry]
Name=Defold
Comment=Defold Engine
Exec=/home/$user/$path/Defold
Icon=/home/$user/$path/icon.png
Terminal=false
Type=Application

For the icon you can use whatever you want, or this from the editor 2 section of the website. Alternatively, the jar inside the packages folder also has the blue logo that matches the editor.

After you’ve got it all setup, move your new Defold.desktop to /usr/share/applications/ and you should be fine.

Now, in my case, using Ubuntu it shows up in the global menu, along every other app.
I still can’t add it to favorites(add it to the dock), but it’s something.
Edit: Apparently you can add to favorites, but you have to do it via the actual applications ‘menu’ and not by right clicking the program icon when it runs.
End result is this, so everything is awesome:
Screenshot from 2017-11-28 11-13-37

8 Likes

Turns out that if you rename the shortcut file to “com.defold.editor.Start.desktop”, instead of whatever you had(e.g. Defold.desktop), but keep the contents the same as above. It integrates fully into gnome shell, with all the bells and whistles.

Another solution is to edit your shortcut, keeping whatever filename you want, and adding StartupWMClass=com.defold.editor.Start to it. Works too.

Also, if you want the shortcut to be something local, to you as a user, instead of moving it to /usr… you can simply move it to ~/.local/share/applications/ works just fine.

Extra bit:

How to know what name to use?

In case you are wondering where this strange name came from, or if you need a solution like this for other apps in the future. The simplest way to get this information is to go to the terminal and run xprop and click on the window of the running program you want to know more about.

All sorts of info will pop up, what we want is WM_CLASS(string). This is what you should use to either name the shortcut or add the “StartupWMClass=” parameter. The actual “Name=” parameter inside the shortcut can be something else entirely, like “Name=Defold” to keep it sane.

6 Likes