File naming

  • Type=Directory if my_file.endswith(".directory") else my_file.endswith(".desktop")
  • reverse DNS
  • D-Bus well-known name
  • my_domain[0].isdigit() if f"_{my_domain}" else my_domain
  • my_domain.replace("-", "_")

Desktop File ID

  • my_file.replace("/", "-")

Basic format of the file

Group headers

[Desktop Entry]

Recognized desktop entry keys

KeyValue TypeREQ?ConditionValue
TypestringYESApplication, Link, Directory
NamelocalestringYES
IconiconstringNO
ExecstringNO
TerminalbooleanNO
Categoriesstring(s)NOdesktop-menu-specification
StartupWMClassstringNOxprop WM_CLASS
URLstringYESType=Link

参照