I added an svg check to the geticon function in mx-idesktool.
If the selected icon is an svg a png copy is placed in ~/.icons/idesk and gets used by idesk.
Code: Select all
geticon()
{
if [ "$comefrom" = "modif" ]; then
iconplaceholder="${currenticon}"
else
iconplaceholder="${icondir}"
fi
#echo "current icon is " "${iconplaceholder}"
cd "${iconplaceholder%/*}"
icon="$($DIALOG --title="Commands" \
--width=600 --height=500 --center \
--button="$TEXT7":3 --button="$TEXT8":1 \
--button="$TEXT9":0 --title "$TEXT23" \
--text="$TEXT19": \
--file-selection="${iconplaceholder}" \
--file-filter="png, svg | *.png *.PNG *.svg *.xpm" \
--filename="${iconplaceholder}")"
retval=$?
icon="$(echo "${icon}" | cut -d '|' -f 2)"
if [[ $icon == *.svg ]]; then
if [ ! -d ~/.icons/idesk ]; then
mkdir ~/.icons/idesk
fi
icon_pngname="$(basename "${icon}" | sed -e "s/\.svg/\.png/")"
icon_pngname=~/.icons/idesk/$icon_pngname
rsvg-convert -w 48 -h 48 $icon -o $icon_pngname
icon=$icon_pngname
fi
case ${retval} in
0) iconvalidate
;;
3) if [ "${comefrom}" = "modif" ]; then
modifycommands
else
newcommands
fi
;;
*) argynope
;;
esac
}
Script attached if someone wants to test. (the geticon function starts at line 495 if you're looking for it)
You'll need to install librsvg2-bin first, it's not installed by default.