Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Linux distribution suggestion - automated creation and/or installation of game .desktop files

A topic by komehara created Sep 14, 2022 Views: 183 Replies: 2
Viewing posts 1 to 2

This is a reboot of Linux feature request - add .desktop files for games (https://itch.io/t/46139/linux-feature-request-add-desktop-files-for-games), a thread from 5 years ago, with last reply 3 years ago, and now archived. I give more information on what I’m looking for.

I just stumbled on this today. My initial motivation was just to fix the app icon not working on my Unity game build on Linux, by providing a custom .desktop file with the correct icon. The task however is not easy, with the two main isues:

  1. You need the .desktop file to be in Desktop or some share/applications folder to work completely (ie to run on double-click and/or be found in the Dash / application searcher). Nemo can open local .desktop files on double-click, but Nautilus users don’t seem able to do that (in latest versions and default config at least). And local .desktop files won’t be registered for application search anyway.

  2. If the .desktop file is moved to those standard folders, a portable file with local path is not enough, you must write a full path to the executable and icon (which requires information on user’s local machine)

Writing a full path to the executable and icon would require some script to be run after installation to get user’s install path, which is not feasible unless I ask the user to run some setup script to generate this .desktop file (akin to Smartgit’s add-menuitem.sh script), which means extra instructions.

If itch.io (more exactly the desktop app) was able to automatically generate the desktop file, it would know about itch.io game install path and thus fill the .desktop file properly. Then, it could put the .desktop file to either the Desktop or some share/applications folder (or both, like Steam, apparently).

So, the user could either: a. upload a custom .desktop file pointing to executable relative path, icon, etc. in a templated format, where some itch.io script would fill some {INSTALL_PATH} variable, and move the .desktop file to the right place b. (better) just upload metadata like executable relative path, icon, etc. (for Linux), and let itch.io generate the .desktop file completely and install it at the right place (less risk of bad .desktop files). itch.io is even capable of finding the executable path since we can Play directly from the itch.io desktop app, so probably only the icon would be needed.

If you are already working on this, what is the current state of development?

Does the itch app put icons for games on the desktop on other platforms?  (<-- genuine question)  If so, then there is a good argument for doing the same on Linux.  If not, not so much.

Personally I hate having game icons on the desktop.  My desktop is already full with stuff that I actually put there and want there, with no extra room for games.  I like to launch my games from the command line.  I'm weird that way.

(1 edit)

No, I don’t think other platforms generate app icons, but on Windows and OSX, binaries are basically the apps, and it’s easy to create a shortcut that will run them (on Windows, you can even put the shortcut on the Start Menu, with categories, to avoid cluttering the desktop). Search speed and quality varies, but generally speaking they are capable to find a binary on your disk (maybe you must add itch.io’s download folder to some search list for it to work with some app launchers, but you only need to do this once). The .desktop file is really a Linux thing, and unless you got an AppImage or something equivalent, automatic wrapping as an app with icon + searchability is not trivial.

Also, note that my suggestion is not only for the Desktop. It is to generate a .desktop file with the proper settings, in order to:

  1. have it detected by searchers and launchers for quick access
  2. set the icon easily

In addition, itch.io devs could always add an option to let the user choose if they want to create a desktop icon or not (like most Windows installers, in fact; I think only Steam added icons to my desktop without asking!)

I personally mostly run apps via my custom launcher, which detects a variety of files, but still needs some .desktop to detect apps, just like Unity desktop’s own dash launcher (maybe some launchers can find binaries directly by name, but that also means they scan a lot of things and it’s more likely to find irrelevant binaries with similar name too). So, it is relevant even if you don’t keep a copy of the .desktop on your Desktop.

If you’re running games from terminal, then a quick access to itch’s game download folder is enough. However, the icon will only work if the developer distributed a binary that sets the app icon automatically (like Unity engine builds).

As a workaround, for now, if somebody knows about a tool that creates .desktop files easily, it would be great!

Alternatively, a centralized launcher (third-party) could do the trick. I tried Lutris with Steam + folders containing DRM-free games, and it worked nice! It scans apps/games from various folders and allows you to quickstart them from a simple interface. I don’t have it installed at the moment, but I probably will reinstall it and try it with itch.io this time. For now, I just launch itch.io desktop, but searching is not necessarily great (it’s hard to search by text among owned games, games downloaded but free so not technically owned, distinguish free/owned from non-owned games in collections, sort by play time, etc. as in Steam). And when I add some games from GOG or Steam, a centralized launcher will be worth it.

This topic has been auto-archived and can no longer be posted in because there haven't been any posts in a while.