$linuxjunkies
>

xdg-icon-resource(1)

Install, uninstall, or manage desktop icon themes and resources following the XDG Icon Theme specification.

UbuntuDebianFedoraArch

Synopsis

xdg-icon-resource install [OPTIONS] --size SIZE [--theme THEME] [--context CONTEXT] ICON_FILE [ICON_NAME]
xdg-icon-resource uninstall [OPTIONS] --size SIZE [--theme THEME] [--context CONTEXT] ICON_NAME
xdg-icon-resource forceupdate [OPTIONS] [--theme THEME]

Description

xdg-icon-resource is a command-line tool for installing, uninstalling, and managing icon files in desktop icon theme directories. It handles the placement of icon files in XDG-compliant locations (typically ~/.local/share/icons/), making icons available to desktop applications and environments.

The command supports multiple icon sizes, themes, and contexts (such as applications, mimetypes, or categories). It automatically creates necessary directories and can trigger icon theme cache updates to ensure icons appear immediately in applications.

Common options

FlagWhat it does
installInstall an icon file into the icon theme
uninstallRemove an icon from the icon theme
forceupdateForce update of icon theme caches
--size SIZESpecify icon size in pixels (e.g., 16, 22, 32, 48, 64, 128)
--theme THEMEInstall into specified theme (default: hicolor)
--context CONTEXTIcon context such as 'applications', 'mimetypes', 'devices' (default: applications)
--mode MODEInstallation mode: user (default) or system
--novendorInstall icon without vendor prefix
--noupdateDo not update icon theme cache after installation

Examples

Install a 48x48 pixel icon named 'myapp.png' as application icon 'myapp'

xdg-icon-resource install --size 48 myapp.png myapp

Install a PDF document icon in the mimetypes context

xdg-icon-resource install --size 64 --context mimetypes document.png application-pdf

Install icon into the gnome theme at 32x32 size

xdg-icon-resource install --size 32 --theme gnome icon.png toolname

Remove the previously installed myapp icon at 48x48 size

xdg-icon-resource uninstall --size 48 myapp

Force regeneration of icon cache for the hicolor theme

xdg-icon-resource forceupdate --theme hicolor

Install icon without vendor name prefix in the path

xdg-icon-resource install --size 128 --novendor logo.png appname

Related commands