LinuxCommandLibrary

desktop-file-validate

validate desktop entry files against specification

TLDR

Validate a desktop entry file

$ desktop-file-validate [path/to/file.desktop]
copy
Validate multiple files
$ desktop-file-validate [file1.desktop] [file2.desktop]
copy
Validate without deprecation warnings
$ desktop-file-validate --no-warn-deprecated [path/to/file.desktop]
copy
Validate and warn about KDE-specific extensions
$ desktop-file-validate --warn-kde [path/to/file.desktop]
copy
Validate all desktop files in a directory
$ desktop-file-validate /usr/share/applications/*.desktop
copy

SYNOPSIS

desktop-file-validate [--no-warn-deprecated] [--warn-kde] FILE...

DESCRIPTION

desktop-file-validate validates desktop entry files (.desktop files) according to the freedesktop.org Desktop Entry Specification. Desktop entry files provide information such as application name, icon, description, and categories for application launchers and menus.
The validation checks for mandatory keys, correct value types, proper escaping, valid categories, and common errors that could cause improper display or misbehavior. The tool is commonly used in packaging workflows and build systems to ensure desktop entries meet specification requirements.
The command returns exit status 0 if all files are valid with no errors or strict warnings. A non-zero exit status (typically 1) indicates validation failures.

PARAMETERS

--no-warn-deprecated

Do not warn about usage of deprecated items from previous specification versions.
--warn-kde
Warn about KDE-specific extensions including KDE Desktop Entry group, ServiceTypes, DocPath, Keywords, InitialPreference keys, and Service/ServiceType/FSDevice types.

CAVEATS

The tool validates against the freedesktop.org specification, which may differ from desktop environment-specific requirements. Some desktop environments accept non-standard extensions that this tool will flag as warnings. The --warn-kde option helps identify KDE-specific extensions when targeting cross-desktop compatibility.

HISTORY

desktop-file-validate is part of the desktop-file-utils package maintained by freedesktop.org. The Desktop Entry Specification was created to provide a standard format for application metadata across Linux desktop environments. The specification has evolved through multiple versions, with desktop-file-validate tracking these changes and providing deprecation warnings for outdated keys.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Raspberry Pi 5 8GB

Raspberry Pi 5 8GB

$134.50
GMKtec Gaming PC, K11 AMD Ryzen 9 8945HS, 32GB DDR5 RAM 1TB Mini PC Desktop Computer, Oculink, Dual NIC 2.5GbE LAN, HDMI/DisplayPort/USB4*2

GMKtec Gaming PC, K11 AMD Ryzen 9 8945HS, 32GB DDR5 RAM 1TB Mini PC Desktop Computer, Oculink, Dual NIC 2.5GbE LAN, HDMI/DisplayPort/USB4*2

$739.99
BOSGAME Mini PC N95, Intel 12th Mini Computers| 16GB DDR4 RAM| 512GB M.2 2280 SSD| 4K 60HZ Triple Displays by Dual HDMI+Type-C, 6W TDP Quiet Mini PC, WIFI5, BT 5.0 Office

BOSGAME Mini PC N95, Intel 12th Mini Computers| 16GB DDR4 RAM| 512GB M.2 2280 SSD| 4K 60HZ Triple Displays by Dual HDMI+Type-C, 6W TDP Quiet Mini PC, WIFI5, BT 5.0 Office

$239.99
Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community

KIWITATA 2X Classic SNES USB Controller for PC Gamings, Retro SNES Wired USB Game Emulator Controller for Windows XP 7 8 11 Mac Raspberry Pi

KIWITATA 2X Classic SNES USB Controller for PC Gamings, Retro SNES Wired USB Game Emulator Controller for Windows XP 7 8 11 Mac Raspberry Pi

$16.99
BOSGAME Mini PC N95, Intel 12th Mini Computers| 16GB DDR4 RAM| 512GB M.2 2280 SSD| 4K 60HZ Triple Displays by Dual HDMI+Type-C, 6W TDP Quiet Mini PC, WIFI5, BT 5.0 Office

BOSGAME Mini PC N95, Intel 12th Mini Computers| 16GB DDR4 RAM| 512GB M.2 2280 SSD| 4K 60HZ Triple Displays by Dual HDMI+Type-C, 6W TDP Quiet Mini PC, WIFI5, BT 5.0 Office

$239.99
Raspberry Pi 5 8GB

Raspberry Pi 5 8GB

$134.50