gtk4-update-icon-cache(1)

๐Ÿฆ‹ gtk4-update-icon-cache โ€” icon theme caching utility

okay bestie, come sit with me, we're learning gtk4-update-icon-cache and it's from the GTK commands manual, part of GTK. Yes this is a real thing, yes it's kinda niche, and yes it's lowkey iconic once you get it. ๐Ÿ’…

โœจ SYNOPSIS โœจ

gtk4-update-icon-cache [OPTIONS...] <PATH>

๐ŸŒธ DESCRIPTION ๐ŸŒธ

not me actually being obsessed with what this lil guy does. gtk4-update-icon-cache makes cache files for icon themes that can be used with mmap(2). periodt.

So the way that it works is: you hand it a PATH pointing at an icon theme directory that's got an index.theme in it โ€” think something like /usr/share/icons/hicolor โ€” and it writes out an icon-theme.cache stuffed full of cached info about all the icons living in the directory tree under that directory. ๐Ÿ โœจ

and why do we care?? bestie because GTK can use the cache files that gtk4-update-icon-cache creates to avoid a LOT of system call and disk seek overhead when the application starts. that's a whole bunch of waiting, just โœจgoneโœจ.

and it gets better โ€” because the format of these cache files is designed to be shareable across multiple processes, for instance using the POSIX mmap(2) system call, the overall memory consumption goes down too. sharing is caring, fr fr. ๐Ÿซถ


๐Ÿ‘‘ OPTIONS ๐Ÿ‘‘

  • -f, --force โ€” overwrite a cache file that already exists, even if it's looking all up-to-date and smug about it. we love a fresh start. ๐Ÿ’–
  • -t, --ignore-theme-index โ€” don't check whether index.theme exists in the icon theme directory. heads up tho: without this option, gtk4-update-icon-cache will flat-out refuse to create an icon cache in a directory that doesn't look like it's the toplevel directory of an icon theme. so if you're being chaotic, this is your flag.
  • -i, --index-only โ€” don't include image data in the cache. index only, minimal vibes, we're being efficient. ๐Ÿงš
  • --include-image-data โ€” include image data in the cache. it's giving full send. ๐ŸŒˆ
  • -c, --source <NAME> โ€” output a C header file declaring a constant NAME with the contents of the icon cache. very coder of you, bestie. ๐Ÿ’œ
  • -q, --quiet โ€” turn OFF verbose output. shhh, no thoughts, just cache. ๐Ÿ™ˆ
  • -v, --validate โ€” validate an existing icon cache. like a vibe check but for your cache file. ๐Ÿ”ฅ

๐ŸŒธ friendly lil reminder: -t/--ignore-theme-index genuinely changes whether the tool will touch a directory at all. no index.theme + no -t = no cache. that's not a bug, that's the boundary, and we respect it. โœจ

made with ๐Ÿ’– by GTK, from the GTK commands manual โ€” paging gtk4-update-icon-cache(1) so your icons load fast and your memory stays cute. slay, go cache something. ๐ŸŽ€๐Ÿฆ‹โญ

๐Ÿ“ฆ where this page comes from
  • ubuntu stonking: gtk-update-icon-cache 4.24.1+ds-1 ยท LGPL-2.0-or-later AND LGPL-2.1-or-later AND sun-permissive AND lcs-telegraphics-permissive AND X11R5-permissive AND MIT AND BSD-3-clause-Google AND Apache-2.0 AND CC0-1.0 AND ZPL-2.1
  • ๐Ÿ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms