|
|
|
@ -31,6 +31,7 @@ else
|
|
|
|
|
icon_root=$container_root/usr/share/icons/hicolor
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
icon_pixmap=false
|
|
|
|
|
if [ "${icon_name:0:1}" = "/" ]; then
|
|
|
|
|
icons=("$container_root$icon_name")
|
|
|
|
|
icon_name=$(basename "$icon_name")
|
|
|
|
@ -40,12 +41,21 @@ if [ "${icon_name:0:1}" = "/" ]; then
|
|
|
|
|
else
|
|
|
|
|
icons=($(sudo find $icon_root -name "$icon_name.*"))
|
|
|
|
|
icon_absolute_path=false
|
|
|
|
|
|
|
|
|
|
if [ ${#icons[@]} == 0 ]; then
|
|
|
|
|
# Pixmap icons (but really, apps should stop putting icons in pixmaps)
|
|
|
|
|
icon_root=$container_root/usr/share/pixmaps
|
|
|
|
|
icons=($(sudo find $icon_root -name "$icon_name.*"))
|
|
|
|
|
icon_pixmap=true
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
[ ${#icons[@]} == 0 ] && die "Cannot find any icon for app $app_name"
|
|
|
|
|
|
|
|
|
|
for icon in ${icons[@]}; do
|
|
|
|
|
if $icon_absolute_path; then
|
|
|
|
|
icon_target=$HOME/.local/share/icons/hicolor/256x256/apps/$icon_name.$icon_ext # See comment before; this is to avoid name conflicts
|
|
|
|
|
elif $icon_pixmap; then
|
|
|
|
|
icon_target=${icon//$icon_root/$HOME/.local/share/icons/hicolor/256x256/apps} # Use 256x256 by default when unspecified
|
|
|
|
|
else
|
|
|
|
|
icon_target=${icon//$icon_root/$HOME/.local/share/icons/hicolor}
|
|
|
|
|
fi
|
|
|
|
|