XDG-ICON-RESOURCE(1)
π XDG-ICON-RESOURCE(1)
okay so bestie, welcome to the xdg-icon-resource manual page β it's part of the xdg-icon-resource Manual, and honestly? it's giving underrated icon-management royalty. π
β¨ NAME β¨
xdg-icon-resource β the command line tool for (un)installing icon resources. that's it. that's the whole vibe. π
πΈ SYNOPSIS πΈ
okay so here's literally every way you can call her. copy these exactly, no cap:
xdg-icon-resource install [--noupdate] [--novendor] [--theme theme]
[--context context] [--mode mode] --size size
icon-file [icon-name]
xdg-icon-resource uninstall [--noupdate] [--theme theme]
[--context context] [--mode mode] --size size
icon-name
xdg-icon-resource forceupdate [--theme theme] [--mode mode]
xdg-icon-resource {--help | --manual | --version}
π¦ DESCRIPTION π¦
so like, the xdg-icon-resource program is your girl for installing icon resources into the desktop icon system β so your menu entries look cute, your desktop icons actually show up, and your file types get a little graphic representation. main character energy for your pixels fr fr. β¨
the desktop icon system finds icons by name, not by "vibes." depending on the size you need, the icon theme you picked, and the context the icon lives in, it goes hunting for the right icon resource to depict that icon. and icon resources can be XPM files or PNG files. that's the whole menu. π
and just so you know she's legit: the desktop icon system works according to the XDG Icon Theme Specification at http://www.freedesktop.org/wiki/Specifications/icon-theme-spec β you know, the icon theme spec. iykyk. π§
π COMMANDS π
installβ installs the icon file indicated byicon-fileinto the desktop icon system under the nameicon-name. real talk: icon names do not have an extension. if you don't hand overicon-name, the name gets derived fromicon-file. the icon file must have.pngor.xpmas its extension. and oh? π if a matching.iconfile exists in the same location asicon-file, it gets installed too. bonus content, we love to see it.uninstallβ removes the icon indicated byicon-namefrom the desktop icon system. heads up bestie: icon names do not have an extension. don't add one. i'm serious. πforceupdateβ forces an update of the desktop icon system. this is only useful if the last call toxdg-icon-resourceincluded the--noupdateoption. so basically: you told her "hold that thought," and now you're telling her "okay go." π
π₯ OPTIONS π₯
--noupdateβ postpones updating the desktop icon system. if you're adding a bunch of icons one after another, this flag says "more changes are coming, you don't gotta refresh the whole desktop icon system right this second." patience, queen. π«Ά--novendorβ normallyxdg-icon-resourcechecks to make sure an icon file going into theappscontext has a proper vendor prefix. this option turns that check off.
so what even is a vendor prefix? it's alpha characters ([a-zA-Z]) terminated with a dash ("-"). companies and organizations are encouraged to use a word or phrase β preferably the organization's name, something they hold a trademark on β as their vendor prefix. and the whole point? preventing name conflicts. so nobody's icon gets confused with anybody else's. β¨
--themethemeβ installs or removes the icon file as part oftheme. if you don't specify a theme, the icons get installed as part of the defaulthicolortheme. applications may install icons under multiple themes, but they should at least install icons for the defaulthicolortheme. like, minimum effort bestie. do the bare minimum and it's this. π--contextcontextβ specifies the context for the icon. icons used in the application menu and as desktop icons should useappsas the context β and that's the default context. icons used as file icons should usemimetypesas the context. other common contexts areactions,devices,emblems,filesystemsandstock. pick your lane, slay. π--sizesizeβ specifies the size of the icon. all icons must be square. periodt. common sizes for icons in theappscontext are:16,22,32,48,64and128. common sizes for icons in themimetypescontext are:16,22,32,48,64and128. (yes, same list. iconic of them honestly.) β--modemodeβmodecan beuserorsystem. inusermode the file is (un)installed for the current user only. insystemmode the file is (un)installed for all users on the system. usually only root is allowed to install insystemmode. π
the default is to use system mode when called by root, and to use user mode when called by a non-root user.
--helpβ show command synopsis. quick lil cheat sheet. π--manualβ show this manual page. hi, you are here. π--versionβ show thexdg-utilsversion information. π
π ENVIRONMENT VARIABLES π
xdg-icon-resource honours the following environment variables β she's polite like that:
XDG_UTILS_DEBUG_LEVELβ setting this environment variable to a non-zero numerical value makesxdg-icon-resourcedo more verbose reporting onstderr. setting a higher value increases the verbosity. so if you're nosy (same), crank it up. πXDG_UTILS_INSTALL_MODEβ this environment variable can be used by the user or administrator to override the installation mode. valid values areuserandsystem. you're in charge now. π
π EXIT CODES π
an exit code of 0 indicates success, while a non-zero exit code indicates failure. the following failure codes can be returned:
1β error in command line syntax.2β one of the files passed on the command line did not exist.3β a required tool could not be found.4β the action failed.5β no permission to read one of the files passed on the command line.
π SEE ALSO π
xdg-desktop-icon(1), xdg-desktop-menu(1), xdg-mime(1), Icon theme specification[1]
π EXAMPLES π
okay so real scenarios, bestie. here's how you'd actually use her.
to install an icon resource to depict a launcher for the application myfoobar, the company ShinyThings Inc. can use:
xdg-icon-resource install --size 64 shinythings-myfoobar.png
to install an icon for a new application/x-foobar file type one can use:
xdg-icon-resource install --context mimetypes --size 48 ./mime-foobar-48.png application-x-foobar
xdg-icon-resource install --context mimetypes --size 64 ./mime-foobar-64.png application-x-foobar
this will install two icons with the name application-x-foobar but with different sizes. and that's how it's done. π
β¨
π AUTHORS π
- Kevin Krammer β Author.
- Jeremy White β Author.
π COPYRIGHT π
Copyright Β© 2006
π NOTES π
- Icon theme specification β
http://www.freedesktop.org/wiki/Specifications/icon-theme-spec/
and that's the whole page bestie!! remember: every flag, every default, every exit code β keep it in your brain. no cap. π«Ά
and before you go β this whole thing comes from xdg-utils 1.0, dated 12/06/2025. that's the version and the date, so you know exactly what era this icon-slinging queen is from. πΈπ go install some icons, you got this. β¨
π¦ where this page comes from
- arch rolling: xdg-utils 1.2.1-2 Β· MIT
- ubuntu resolute: xdg-utils 1.2.1-2ubuntu2 Β· MIT
- ubuntu stonking: xdg-utils 1.2.1-2ubuntu2 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms