4

Today, I bought Project Hospital game on Steam for my Linux Mint 19 Cinnamon.

I do have only this game installed, so I am unable to determine if the issue persists with other games.

While the game runs fine, I am unable to create a .desktop file via menu:

Right mouse click on Project Hospital -> Create Desktop Shortcut menu item.

It will say (transcript):

Could not create shortcut.
A shortcut to this game is probably already on the desktop.

Likewise, it did not create the menu entry for this game.

(Picture version unavailable - for some reason, I am unable to screenshot the modal popup.)

I have the Steam version dated 2018-Nov-26:

my Steam version dated 2018-Nov-26


Is it possible to create the .desktop file by hand?

If yes, would you explain what at the bare minimum it must contain? And is there a way to validate it after creation?

1 Answer 1

7

TL;DR

Create the .desktop file with contents, the Steam Id of Project Hospital is 868360, you can see this number inside the Steam link, e.g.:

https://store.steampowered.com/app/868360/Project_Hospital/

[Desktop Entry]
Name=[replace with the game name]
Exec=steam steam://rungameid/[replace with a number = Steam Id of the game]
Icon=[replace with a path to some image you find suitable]
Terminal=false
Type=Application
Categories=Game

You can validate the syntax with the following command:

desktop-file-validate /path/to/the/desktop/file

It won't say anything if it does not find an error.


Details

There already is a closed issue ticket on GitHub for this topic which is allegedly a duplicate of this ticket. The open ticket for this issue is: https://github.com/ValveSoftware/steam-for-linux/issues/5590

But there is no workaround written anywhere. It has been closed as resolved dated on 2017-Nov-8, which was a year ago.

I do not understand why this still is an issue when closed, but anyway...

You should run chmod +x on this file placed on your Desktop, and not so if placed in your menu.

Location of my user Desktop items: ~/Desktop

Location of my global Menu items: /usr/share/applications/


Debugging - my Steam issue ticket comment transcript

For what it's worth, I have just submitted to the open ticket, thanks Aaron for the comment by the way:


So, let's get right into it and debug this thing finally!

$ ls -lhF ~/.local/share/Steam/steam/games/

-rwxrwxr-x 1 vlastimil vlastimil 102K Dec  4 14:51 051f52fdea67d8f16a20daaccaf2fbfa1823d202.ico*
-rwxrwxr-x 1 vlastimil vlastimil 159K Nov 12 12:06 3f2b22c6d7bca4d39f06c203d16facb50014bbbb.ico*
-rw-rw-r-- 1 vlastimil vlastimil 178K Oct 17 10:00 61f9291306d3f002cc749d437ce84c42c9c9d52d.ico
-rw-rw-r-- 1 vlastimil vlastimil  11K Sep 26 15:13 75a21c39178811f5ec421d85a58fa2a07c2633b7.ico
-rwxrwxr-x 1 vlastimil vlastimil  60K Nov 27 03:42 7f263bfdc0c2df24b756d7e87472c6b447ee8538.ico*
-rwxrwxr-x 1 vlastimil vlastimil 362K Nov 19 13:09 866ec9836186e7127888bfd7a11231a3971f105d.ico*
-rwxrwxr-x 1 vlastimil vlastimil  602 Feb  4  2010 PlatformMenu.vdf*
-rwxrwxr-x 1 vlastimil vlastimil 9,9K May  4  2006 SteamMovie.ico*

First strange thing you'll notice here is that some of the files have an execute flag (indicated also with an asterisk after file name).

Second thing you'll notice here is that some files are tiny, others are larger to be an icon on itself.

So, running the following will reveal more:

$ file ~/.local/share/Steam/steam/games/*

/home/vlastimil/.local/share/Steam/steam/games/051f52fdea67d8f16a20daaccaf2fbfa1823d202.ico: Zip archive data, at least v1.0 to extract
/home/vlastimil/.local/share/Steam/steam/games/3f2b22c6d7bca4d39f06c203d16facb50014bbbb.ico: Zip archive data, at least v2.0 to extract
/home/vlastimil/.local/share/Steam/steam/games/61f9291306d3f002cc749d437ce84c42c9c9d52d.ico: MS Windows icon resource - 5 icons, 16x16, 32 bits/pixel, 24x24, 32 bits/pixel
/home/vlastimil/.local/share/Steam/steam/games/75a21c39178811f5ec421d85a58fa2a07c2633b7.ico: Zip archive data, at least v2.0 to extract
/home/vlastimil/.local/share/Steam/steam/games/7f263bfdc0c2df24b756d7e87472c6b447ee8538.ico: Zip archive data, at least v2.0 to extract
/home/vlastimil/.local/share/Steam/steam/games/866ec9836186e7127888bfd7a11231a3971f105d.ico: MS Windows icon resource - 6 icons, 16x16, 32 bits/pixel, 32x32, 32 bits/pixel
/home/vlastimil/.local/share/Steam/steam/games/PlatformMenu.vdf:                             ASCII text, with CRLF line terminators
/home/vlastimil/.local/share/Steam/steam/games/SteamMovie.ico:                               MS Windows icon resource - 6 icons, 16x16, 4 bits/pixel, 16x16, 8 bits/pixel

Now, that we know some of the files are actually .zip archives, let's take a closer look at them, copy them to safe location first:

$ mkdir -p ~/steamIcons && cp ~/.local/share/Steam/steam/games/*.ico ~/steamIcons && cd ~/steamIcons && rm SteamMovie.ico

Now, let's remove the execute permission as it should not be there at all by my standards, and list what we got:

$ chmod -x * && ls -lh

-rw-r--r-- 1 vlastimil vlastimil 102K Dec  6 23:54 051f52fdea67d8f16a20daaccaf2fbfa1823d202.ico
-rw-r--r-- 1 vlastimil vlastimil 159K Dec  6 23:54 3f2b22c6d7bca4d39f06c203d16facb50014bbbb.ico
-rw-r--r-- 1 vlastimil vlastimil 178K Dec  6 23:54 61f9291306d3f002cc749d437ce84c42c9c9d52d.ico
-rw-r--r-- 1 vlastimil vlastimil  11K Dec  6 23:54 75a21c39178811f5ec421d85a58fa2a07c2633b7.ico
-rw-r--r-- 1 vlastimil vlastimil  60K Dec  6 23:54 7f263bfdc0c2df24b756d7e87472c6b447ee8538.ico
-rw-r--r-- 1 vlastimil vlastimil 362K Dec  6 23:54 866ec9836186e7127888bfd7a11231a3971f105d.ico

We should probably separate those icons from archives now:

$ mkdir -p ico zip
$ mv 61f9291306d3f002cc749d437ce84c42c9c9d52d.ico 866ec9836186e7127888bfd7a11231a3971f105d.ico ico/
$ mv *.ico zip/

And give those zip archives proper extension:

$ for file in *; do mv "${file}" "${file}.zip"; done && ls -lh

Now, I would like to create a directory for each of the zip files, and unzip those file in the directories:

$ for filename in *; do dirname="${filename%.zip}"; dirname="${dirname%.ico}"; mkdir -p "${dirname}"; unzip "${filename}" -d "${dirname}";rm "${filename}"; done

I need to see the directory structure now. You probably won't have tree installed, so let's install it, on my Ubuntu based Linux:

$ sudo apt-get install tree

And let's see what we have:

$ tree

.
├── 051f52fdea67d8f16a20daaccaf2fbfa1823d202
│   └── icons
│       ├── icon_16.png
│       ├── icon_24.png
│       ├── icon_32.png
│       ├── icon_64.png
│       └── icon_96.png
├── 3f2b22c6d7bca4d39f06c203d16facb50014bbbb
│   ├── 128x128.png
│   ├── 16x16.png
│   ├── 24x24.png
│   ├── 256x256.png
│   ├── 32x32.png
│   ├── 64x64.png
│   └── 96x96.png
├── 75a21c39178811f5ec421d85a58fa2a07c2633b7
│   ├── Hexcells Icon 128.png
│   ├── Hexcells Icon 16.png
│   ├── Hexcells Icon 32.png
│   ├── Hexcells Icon 64.png
│   └── Hexcells Icon 96.png
└── 7f263bfdc0c2df24b756d7e87472c6b447ee8538
    ├── civ5.png
    └── __MACOSX

6 directories, 18 files

As far as I can see, here we have unfortunately a few non-identifiable games, so better see in GUI:

icons_folder_screenshot

And I think I have found the cause now!

As you may see for yourself, the games that did work have the png icons right inside the directory, whereas the game which did not work in my test case (Project Hospital) has a sub-directory called icons which then contains those icons.

Case solved, @kisak-valve Please adjust the Steam client to handle these cases. Thank you.

4
  • 1
    Needing to be root and modifying your operating system is the Wrong Thing To Do and it is Bad Advice. Put the .desktop file in ${HOME}/.local/share/applications instead, where you have permission. Dec 6, 2018 at 15:07
  • @StephenM.Webb Maybe so, a good comment you have made. But I only suggested to place it to the global directory. Of course, you have a point, but I feel I did not force anyone to think this is the only or the proper way. It's just my way. Dec 6, 2018 at 15:10
  • 1
    Looking at the posted issue's comment it looks like a newer issue with similar symptoms has been opened this July : github.com/ValveSoftware/steam-for-linux/issues/5590
    – Aaron
    Dec 6, 2018 at 15:25
  • It's also possible to put items on your user Menu by putting the corresponding .desktop files in ~/.local/share/applications.
    – david
    Dec 6, 2018 at 19:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .