Skip to content
Myr

icon: fix #622 pixmaps not searched in /usr/local/share

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Even if FreeDesktop's Icon Theme Specification only mentions /usr/share explicitely as a base dir to look for pixmaps (while icons is searched in both /usr/local/share and /usr/share), some implementations do store their icons in /usr/local/share/pixmaps: they weren't found by Fuzzel. This was obvious in FreeBSD, which uses exclusively /usr/local, and in notably missing pixmaps was firefox.png

authored by Guillaume Outters · committed by Guillaume Outters · parent 4c1ba8f · Browse files · 1 file+17 added−8 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+17 added−8 removed

  • other:+17 added−8 removed

1 file+17 added−8 removed

modified:icon.c+17 added-8 removed
295 unmodified lines
296 free(path);297 }298299 {300 /* /usr/local/share/pixmaps and usr/share/pixmaps:301 * Even if the specification only mentions /usr/share302 * explicitely as a base dir to look for pixmaps (while icons303 * is searched in both), some distributions do use304 * /usr/local/share/pixmaps (e.g. firefox.png under FreeBSD).305 */306 const char **paths = (const char *[]) { "/usr/local/share/pixmaps", "/usr/share/pixmaps", NULL };307 const char *path;300 const char *path = "/usr/share/pixmaps";301 int fd = open(path, O_RDONLY | O_DIRECTORY | O_CLOEXEC);302 if (fd >= 0) {303 struct xdg_data_dir home_icons = {304 .path = xstrdup(path),305 .fd = fd,306 };308 while ((path = *paths++) != NULL) {309 int fd = open(path, O_RDONLY | O_DIRECTORY | O_CLOEXEC);310 if (fd >= 0) {311 struct xdg_data_dir home_icons = {312 .path = xstrdup(path),313 .fd = fd,314 };315308 tll_push_back(dirs, home_icons);316 tll_push_back(dirs, home_icons);317 }318 }319 }320321 return dirs;
533 unmodified lines