1 # shellcheck shell=bash
3 # Populate XDG_ICON_DIRS
4 hicolorIconThemeHook
() {
6 # where to find icon themes
7 if [ -d "$1/share/icons" ]; then
8 addToSearchPath XDG_ICON_DIRS
"$1/share"
12 # I think this is meant to be a runtime dep
13 addEnvHooks
"${targetOffset:?}" hicolorIconThemeHook
15 # Make symbolic links of parent icon themes that are inherited in the
16 # icon themes installed by the package.
17 symlinkParentIconThemes
() {
18 if [ -e $out/share
/icons
]; then
19 echo Symlinking parent icon themes...
27 for theme
in $out/share
/icons
/*/index.theme
; do
28 theme_name
="${theme%/*}"
29 theme_name
="${theme_name##*/}"
30 echo " theme: $theme_name"
31 inheritance
=$
(sed -rne 's,^Inherits=(.*)$,\1,p' "$theme")
32 IFS
=',' read -ra parent_themes
<<< "$inheritance"
33 for parent_theme
in "${parent_themes[@]}"; do
35 if [ -e "$out/share/icons/$parent_theme" ]; then
36 parent_path
="$(realpath "$out/share
/icons
/$parent_theme")"
38 IFS
=':' read -ra dirs <<< $XDG_ICON_DIRS
39 for parent_dir
in "${dirs[@]}"; do
40 if [ -e "$parent_dir/icons/$parent_theme/index.theme" ]; then
41 parent_path
="$(realpath "$parent_dir/icons
/$parent_theme")"
42 ln -s "$parent_path" "$out/share/icons/"
47 echo " parent: $parent_theme -> $parent_path"
53 preFixupHooks
+=(symlinkParentIconThemes
)