PSA: Many games have broken .desktop files

PSA: Many games have broken .desktop files

Postby Wuzzy » 14 Jul 2018, 05:18

I have checked a couple of Desktop Entry (.desktop) files of games for conformity with the Desktop Entry specification 1.1.

Turns out a lot of them are broken:

sauerbraten.desktop:
[WD] Line 2: Deprecated key “Encoding”
[EE] Line 10: Invalid category: “Application”

teeworlds.desktop:
[WD] Line 2: Deprecated key “Encoding”

sr-editor.desktop:
[EE] Line 17: Invalid category: “Application”

stone-soup.desktop:
[WD] Line 2: Deprecated key “Encoding”
[EE] Line 10: Invalid category: “Application”

goonies.desktop:
[WD] Line 2: Deprecated key “Encoding”
[EE] Line 9: Invalid category: “Application”

irrlamb.desktop:
[EE] Line 8: Invalid category: “PuzzleGame”

ufoai-safe.desktop:
[WD] Line 3: Deprecated key “Encoding”
[EE] Line 12: Invalid category: “Application”

stuntrally.desktop:
[EE] Line 14: Invalid category: “Application”

blockout2.desktop:
[WD] Line 3: Deprecated key “Encoding”
[EE] Line 9: Boolean setting “Terminal” has invalid value “False”
[EE] Line 10: Invalid category: “Application”

CorsixTH.desktop:
[WW] Line 3: Version 0.41-r1078 is not recognized
[WD] Line 10: Deprecated key “Encoding”

astromenace.desktop:
[WD] Line 2: Deprecated key “Encoding”
[EE] Line 10: Invalid category: “Application”

opendungeons.desktop:
[WW] Line 3: Version 0.7.1 is not recognized

xonotic-sdl.desktop:
[WW] Line 3: Version 2.5 is not recognized
[WD] Line 4: Deprecated key “Encoding”

lix.desktop:
[WD] Line 2: Deprecated key “Encoding”

assaultcube.desktop:
[WD] Line 2: Deprecated key “Encoding”
[EE] Line 7: Invalid Desktop Entry key “MultipleArgs”

nexuiz-sdl.desktop:
[WD] Line 3: Deprecated key “Encoding”

scorched3d.desktop:
[WD] Line 2: Deprecated key “Encoding”
[EE] Line 10: Invalid category: “Application”

vulture-slashem.desktop:
[WD] Line 8: Deprecated key “Encoding”
[EE] Line 9: Invalid category: “Application”
[EE] Line 9: Invalid category: “3DGame”
[EE] Line 9: Invalid category: “PuzzleGame”

cdogs.desktop:
[WD] Line 2: Deprecated key “Encoding”

abuse.desktop:
[WD] Line 2: Deprecated key “Encoding”
[EE] Line 10: Invalid category: “Application”

mrrescue.desktop:
[WD] Line 2: Deprecated key “Encoding”
[EE] Line 10: Invalid category: “Application”

freedroidrpg.desktop:
[EE] In group “Desktop Entry”: URL specified, but desktop entry is not of type “Link”

acreloaded.desktop:
[WD] Line 2: Deprecated key “Encoding”
[EE] Line 7: Invalid Desktop Entry key “MultipleArgs”

fillets-ng.desktop:
[WD] Line 2: Deprecated key “Encoding”
[EE] Line 10: Invalid category: “Application”
[EE] Line 10: Empty category name supplied

pingus.desktop:
[WD] Line 2: Deprecated key “Encoding”
[EE] Line 8: Invalid category: “Application”

lostsky.desktop:
[WD] Line 2: Deprecated key “Encoding”
[EE] Line 10: Invalid category: “Application”

ufoded.desktop:
[WD] Line 3: Deprecated key “Encoding”
[EE] Line 12: Invalid category: “Application”

frozen-bubble.desktop:
[WD] Line 4: Deprecated key “Encoding”

xye.desktop:
[WD] Line 4: Deprecated key “Encoding”
[EE] Line 7: Invalid category: “Application”
[EE] Line 7: Invalid category: “PuzzleGame”

chroma.desktop:
[WD] Line 2: Deprecated key “Encoding”

paintown.desktop:
[EE] Line 8: Invalid category: “Application”

wordwarvi.desktop:
[WD] Line 3: Deprecated key “Encoding”
[EE] Line 9: Invalid category: “Arcade”

nexuiz-glx.desktop:
[WD] Line 3: Deprecated key “Encoding”

pysol.desktop:
[WD] Line 2: Deprecated key “Encoding”

glob2.desktop:
[WD] Line 3: Deprecated key “Encoding”
[EE] Line 11: Invalid category: “Application”

vulture-nethack.desktop:
[WD] Line 8: Deprecated key “Encoding”
[EE] Line 9: Invalid category: “Application”
[EE] Line 9: Invalid category: “3DGame”
[EE] Line 9: Invalid category: “PuzzleGame”

rocksndiamonds.desktop:
[WD] Line 2: Deprecated key “Encoding”
[EE] Line 9: Invalid category: “Application”

blobby2.desktop:
[WD] Line 2: Deprecated key “Encoding”

blobwars.desktop:
[WD] Line 2: Deprecated key “Encoding”

uqm.desktop:
[WD] Line 9: Deprecated key “Encoding”
[EE] Line 10: Invalid category: “Application”

hase.desktop:
[WD] Line 2: Deprecated key “Encoding”
[EE] Line 11: Empty category name supplied

xonotic-glx.desktop:
[WW] Line 3: Version 2.5 is not recognized
[WD] Line 4: Deprecated key “Encoding”

ufoai.desktop:
[WD] Line 3: Deprecated key “Encoding”
[EE] Line 12: Invalid category: “Application”


If your game is in the list, and there is an “[EE]”, this means your Desktop Entry is broken!
[WW] is a warning which might or might not be an error.
[WD] is just a deprecation warning. It's not an error. You can remove the deprecated thing if you want, but it's really not important now.


Most common errors:
- Adding the fake category “Application”. There is no such category, it's pointless. It's always an application!
- Adding categories which are not defined in the standard, like “PuzzleGame”. Appropriate would have been “LogicGame” instead. Only use categories listed here: spec. Non-standard categories like PuzzleGame are an error, as “Categories not in this document must be prefixed by the string ‘X-’ indicating that they are extensions”
- Version misunderstood. This field is for the specification version, not the application version! Current specification version is 1.1

About the “False” in blockout2: Must be lowercase.

Most common warnings:
Deprecated key “Encoding”. All Desktop Entry files are now assumed to be UTF-8 encoded. You can safely remove this key now, but it's not a problem if you don't remove it now.


Another thing I have noticed: Many games do add “Game” to Categories, but a few games don't add the genre. You should probably add one of the more specific game genres as well, like ActionGame or StrategyGame, see the spec. The Categories key for a strategy game would look like this:

{l Code}: {l Select All Code}
Categories=Game;StrategyGame


How to check YOUR Desktop Entry:
https://www.freedesktop.org/wiki/Softwa ... ile-utils/

References:
Desktop Entry spec 1.1
Desktop Menu spec 1.1 (includes list of standard categories)


EDIT: Oops. Turns out the “Shooter” category is actually valid now, since Desktop Menu 1.1 (is no longer a draft).
Last edited by Wuzzy on 14 Jul 2018, 12:04, edited 1 time in total.
Got too many bitcoins? I gladly take them: 17fsUywHxeMHKG41UFfu34F1rAxZcrVoqH :-)
User avatar
Wuzzy
 
Posts: 591
Joined: 28 May 2012, 23:13

Re: PSA: Many games have broken .desktop files

Postby c_xong » 14 Jul 2018, 07:25

Thanks; is there a good tool to help create desktop files? This one for example https://tools.nasqueron.org/generators/ ... sktop-file still uses the deprecated Encoding key.
User avatar
c_xong
 
Posts: 233
Joined: 06 Sep 2013, 04:33

Re: PSA: Many games have broken .desktop files

Postby Wuzzy » 14 Jul 2018, 11:42

cdogs.desktop looks mostly fine to me, just the Encoding key is deprecated.

The tool you linked to is pretty bad anyway. No version key (it's optional, but always a good idea to include), keys are written even if you don't enter a value (e.g. Comment), Terminal inserts invalid values like “True” or “False” although is must be “true” or “false”, no categories key and, yes, Encoding still present.

I don't know if there is a proper tool; I don't think so.
Got too many bitcoins? I gladly take them: 17fsUywHxeMHKG41UFfu34F1rAxZcrVoqH :-)
User avatar
Wuzzy
 
Posts: 591
Joined: 28 May 2012, 23:13

Re: PSA: Many games have broken .desktop files

Postby Wuzzy » 14 Jul 2018, 12:03

I think for most games you can use this minimal template:
{l Code}: {l Select All Code}
[Desktop Entry]
Version=1.1
Type=Application
Name=<NAME>
GenericName=<GENERIC NAME>
Comment=<SHORT DESCRIPTION>
Icon=<ICON>
Exec=<EXEC>
Terminal=<true/false>
Categories=Game;<GENRE>
Keywords=<SEMICOLON-SEPARATED LIST OF KEYWORDS>


See Desktop Menu spec for list of genres, in “Additional categories”.

This template might not be for all applications, mind you. Always test your stuff. ^^

Oh, it looks like Shooter is now a valid category as well (since Desktop Menu 1.1). Cool.
Got too many bitcoins? I gladly take them: 17fsUywHxeMHKG41UFfu34F1rAxZcrVoqH :-)
User avatar
Wuzzy
 
Posts: 591
Joined: 28 May 2012, 23:13

Re: PSA: Many games have broken .desktop files

Postby GunChleoc » 28 Jul 2018, 10:14

Thanks for the link, I'll use the tool in Widelands :)
User avatar
GunChleoc
 
Posts: 323
Joined: 20 Sep 2012, 22:45

Who is online

Users browsing this forum: No registered users and 1 guest