xdg-desktop-icon
Create or remove desktop icons
SYNOPSIS
xdg-desktop-icon { install | uninstall } [--novendor] <desktop-file>
xdg-desktop-icon { --help | --version }
PARAMETERS
install
Installs the specified .desktop file to the user's desktop directory, making it accessible as a desktop icon.
uninstall
Removes the specified .desktop file from the user's desktop directory.
--novendor
Prevents the addition of a vendor prefix (e.g., 'myapp-') to the installed .desktop filename. By default, xdg-desktop-icon may add a prefix derived from the desktop file's vendor name to avoid name collisions.
The path to the .desktop file that is to be installed or uninstalled. This file must conform to the Desktop Entry Specification.
--help
Displays a help message and exits.
--version
Displays version information and exits.
DESCRIPTION
The xdg-desktop-icon command is a utility that allows applications to install or uninstall an icon on the user's desktop. It is part of the xdg-utils package, which provides a set of command-line tools to integrate applications with the freedesktop.org desktop environment. This command handles the complexities of different desktop environments (such as GNOME, KDE, XFCE, and LXQt) by placing the specified .desktop file in the correct, user-specific desktop directory, respecting the user's configuration and standard directory layouts.
Its primary use case is within application installation scripts, providing a standardized and cross-desktop way to offer users a convenient shortcut to launch newly installed applications directly from their desktop. It takes care of ensuring the .desktop file is properly named and placed for the current desktop environment.
CAVEATS
The command relies on the xdg-utils package being properly installed and configured on the system. It does not create or modify the content of the .desktop file itself, only its placement or removal. The <desktop-file> must be a valid file conforming to the Desktop Entry Specification. Functionality may vary slightly across different desktop environments if their integration with xdg-utils is incomplete or non-standard.
EXIT STATUS
The command returns 0 on success, or a non-zero exit code on failure.
1: Error in command line syntax.
2: File not found.
3: User not authorized to perform the operation.
4: Internal error.
ENVIRONMENT VARIABLES
XDG_DATA_HOME: Specifies the user-specific data directory. If unset, defaults to $HOME/.local/share.
XDG_DATA_DIRS: A colon-separated list of base directories relative to which user data files should be searched. If unset, defaults to /usr/local/share/:/usr/share/.
DESKTOP_SESSION and XDG_CURRENT_DESKTOP: Used by xdg-utils to identify the currently running desktop environment and adjust behavior accordingly.
HISTORY
xdg-desktop-icon is part of the xdg-utils suite, which originated from the freedesktop.org project's efforts to standardize desktop integration across various Linux desktop environments like GNOME and KDE. The development of xdg-utils began around 2005, aiming to provide a set of common tools that application developers could rely on for tasks such as opening files, managing MIME types, and installing desktop shortcuts, thus promoting greater interoperability and a consistent user experience.
SEE ALSO
xdg-open(1), xdg-mime(1), xdg-settings(1), xdg-desktop-menu(1), desktop-file-install(1), update-desktop-database(1)