Merge remote-tracking branch 'woju/master' into appicons
This commit is contained in:
commit
c0c914faab
@ -3,12 +3,18 @@ read filename
|
|||||||
|
|
||||||
if [[ "${filename}" = xdgicon:* ]]; then
|
if [[ "${filename}" = xdgicon:* ]]; then
|
||||||
# get biggest icon from hicolor theme
|
# get biggest icon from hicolor theme
|
||||||
candidate=$(find /usr/share/icons/hicolor -type f -name "${filename#*:}.png" | xargs ls --sort=size | head -1)
|
|
||||||
|
|
||||||
if [[ ! "$(basename "${candidate}")" = "${filename#*:}.png" ]]; then
|
filename="${filename#*:}.png"
|
||||||
# file not found, ls returned garbage
|
candidate=
|
||||||
exit 1
|
for dir in /usr/share/icons/{hicolor/,}; do
|
||||||
|
candidate=$(find -L "${dir}" -type f -name "${filename}")
|
||||||
|
if [[ -n "${candidate}" ]]; then
|
||||||
|
candidate=$(echo "${candidate}" | xargs ls --sort=size | head -1)
|
||||||
|
break
|
||||||
fi
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
[[ -n "${candidate}" ]]
|
||||||
filename="${candidate}"
|
filename="${candidate}"
|
||||||
|
|
||||||
elif [[ "${filename}" = "-" ]] || [[ "${filename}" = *":-" ]]; then
|
elif [[ "${filename}" = "-" ]] || [[ "${filename}" = *":-" ]]; then
|
||||||
@ -23,7 +29,9 @@ elif ! [[ -r "${filename}" ]]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
identify -format '%w %h' "$filename"
|
# identify in F18 (6.7) adds implicit '\n' to format,
|
||||||
|
# whereas identify in F20 (6.8) does not
|
||||||
|
identify -format '%w %h\n' "$filename" | sed -e '/^$/d'
|
||||||
convert -depth 8 "$filename" rgba:-
|
convert -depth 8 "$filename" rgba:-
|
||||||
|
|
||||||
[[ -n "${tmpfile}" ]] && rm -f ${tmpfile} || true
|
[[ -n "${tmpfile}" ]] && rm -f ${tmpfile} || true
|
||||||
|
Loading…
Reference in New Issue
Block a user