delay a few things on startup, such as setting the visibility mode, which ensures...
[personal-kdebase.git] / runtime / pics / oxygen / scalable / export_pngs.sh
blobd44d8b91a89b7e7fa155ea58e982235139a0b8e1
1 #!/bin/bash
3 sizes="128 64 48 32 22 16"
4 folders="actions apps devices filesystems mimetypes"
5 smallexport="yes"
6 date=`date '+%F-%H-%M'`
7 curdir=$(pwd)'/'
8 icon=$1
9 usingGui="true"
10 max_small="48"
12 if [ "$icon" == "" ]; then
13 icon=$(kdialog --getopenfilename $curdir)
14 else
15 icon=$curdir$icon
16 usingGui="false"
19 iconName=$(basename $icon)
20 iconDir=$(basename `dirname $icon`)
21 iconPngName=$( echo $iconName | cut -d . -f -1 )".png"
23 inkscape --without-gui --export-png=$iconPngName --export-dpi=72 --export-background-opacity=0 --export-width=512 --export-height=512 $icon > /dev/null
25 for size in $sizes; do
26 prefix="../${size}x${size}"
27 # ====== shall we use a small icon if available?
28 if [ $size -le $max_small ]; then
29 smallicon="$iconDir/small/${size}x${size}/$iconName"
30 if [ -e $smallicon ]; then
31 inkscape --without-gui --export-png="../"${size}x${size}"/"$iconDir"/"$iconPngName --export-dpi=72 --export-background-opacity=0 --export-width=$size --export-height=$size $smallicon > /dev/null
33 else
34 convert -filter Sinc -resize ${size}x${size} $iconPngName "../"${size}x${size}"/"$iconDir"/"$iconPngName
36 else
37 convert -filter Sinc -resize ${size}x${size} $iconPngName "../"${size}x${size}"/"$iconDir"/"$iconPngName
39 echo "Converted the icon named "$( echo $iconName | cut -d . -f -1 )" to size: " $size
40 done
42 rm $iconPngName
44 for size in $sizes; do
45 svn add "../"${size}x${size}"/"$iconDir"/"$iconPngName
46 done
48 if $usingGui; then
49 kdialog --msgbox "Icon converted and added to SVN"
50 else
51 echo "Icon converted"