Users and Devs: Easily add Trine 2 to Linux launcher menus

For discussion about Trine 2, released in December 2011 on Windows, Mac, Xbox, PlayStation Network and later on Linux and Wii U.
Posts: 2
Joined: Thu Sep 12, 2013 7:12 pm

Users and Devs: Easily add Trine 2 to Linux launcher menus

Postby ssokolow » Thu Sep 12, 2013 8:19 pm

Hey, devs. Given how simple this is, could it be added to your first-run wizard? (Speaking of which, nice job. Best experience I've ever had outside a .deb package and best experience period for installing to ~/opt... but I do want a launcher menu icon and don't want a desktop icon.)

  • Trine 2 will be visible to any launcher the user might use. (Menu, Unity, GNOME Do, etc.)
  • You get a launcher entry which knows to vanish if you delete Trine 2 without using a specialized uninstaller.

Instructions (Structured for Users):
  1. Open ~/Desktop/trine2.desktop in your text editor of choice. (gedit, kate, mousepad, leafpad, etc.)
  2. Change Categories= to Categories=Game; so it will show up in the right place.
  3. Make a copy of the Exec line and change it to TryExec so the icon knows to vanish if Trine 2 is deleted.
  4. Rename the file from trine2.desktop to frozenbyte-trine2.desktop to satisfy the vendor prefix check.
  5. Run xdg-desktop-menu install ~/Desktop/frozenbyte-trine2.desktop to copy it into the launcher system.
  6. You can now delete the desktop icon if you want to.

Extra Suggestion for Devs: You may also want to add a Comment=... line to the desktop file. A lot of launchers use it as an explanatory tooltip. (Desura fills in the game's description when generating launchers, so the original Trine gets a launcher tooltip that begins with "Trine is a beautiful fantasy action platformer". (I won't clutter up the post with the full thing.)

Explanatory Notes:
  • You could also use Categories=Game;Platformer; like the Desura-generated launcher for the original Trine, but "Platformer" isn't technically valid and will have no effect in any spec-compliant launcher since Categories is supposed to only use values from the list list in the spec. There isn't really a proper category for platformers in the current version of the spec so I usually use Categories=Game;ActionGame;.
  • The TryExec line tells the launcher that the icon's visibility should be conditional on whether the specified file exists and is executable. It's separate from Exec because some apps need to be launched by wrappers like optirun, aoss, or pasuspender which don't get uninstalled when the game goes away. Just making a copy of the Exec line works for Trine 2 because of how simple the Exec line is. ...and no, I don't know why TryExec must be provided to get the auto-hiding behaviour even when it's identical to Exec.
  • xdg-desktop-menu wants launcher names to be namespaced by vendor to avoid the need to use Windows-style GUIDs for distinguishing between upgrades and namespace collisions. Hence, the final step will abort if the filename doesn't take the form vendorname-appname.desktop

User avatar
Posts: 267
Joined: Wed Nov 23, 2011 4:09 pm
Location: Finland

Re: Users and Devs: Easily add Trine 2 to Linux launcher men

Postby FB_JussiE » Fri Sep 13, 2013 8:27 am

Hello ssokolow!

Thank you for positive feedback on the first-run wizard! I wasn't really sure if users would "approve" of it over the more traditional installers.
Very nice suggestions, I will look in to adding them to the script, hopefully in the near future.

EDIT: I've added these changes to the script and they will be included in the next patch, how ever we don't have any plans (==date) for patch at the moment so it might take a moment. Thank you again for the feedback, always happy to improve the Linux process (especially when it is as simple as this :P)

Posts: 2
Joined: Thu Sep 12, 2013 7:12 pm

Re: Users and Devs: Easily add Trine 2 to Linux launcher men

Postby ssokolow » Fri Sep 13, 2013 4:49 pm

Glad to hear it. There is one other thing...

You might want to look into adding a "your post has been queued for moderation" message to the forums (or, if there is one, fixing it to show up when Javascript is disabled).

I ended up also sending a paraphrased version of that message to the support e-mail address because I didn't know if something had gone wrong.

Return to “Trine 2”

Who is online

Users browsing this forum: No registered users and 4 guests