Move and refactor tool cursor generation script
--HG-- branch : feature
This commit is contained in:
parent
6ffa9d0055
commit
e89f730b38
22
scripts/generate_tool_cursor.sh
Executable file
22
scripts/generate_tool_cursor.sh
Executable file
|
@ -0,0 +1,22 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# usage:
|
||||||
|
# $ ./generate_tool_cursor.sh
|
||||||
|
|
||||||
|
PATTERN=*@2x.png
|
||||||
|
TOOLICONPATH=../src/app/valentina/share/resources/toolicon/32x32/
|
||||||
|
TOOLICONS=`ls $TOOLICONPATH$PATTERN`
|
||||||
|
OUTPATH=../src/app/valentina/share/resources/cursor/svg
|
||||||
|
|
||||||
|
|
||||||
|
for var in $TOOLICONS
|
||||||
|
do
|
||||||
|
basename=${var##*/}
|
||||||
|
basename=${basename%.png}
|
||||||
|
basename=${basename%@2x} # remove optional @2x suffix
|
||||||
|
if [ ! -f $basename@2x.png ]; then # always prefere hidpi version
|
||||||
|
sed "s/<<basename>>/$basename@2x/" $OUTPATH/template_cursor.svg > $OUTPATH/${basename}_cursor.svg
|
||||||
|
else
|
||||||
|
sed "s/<<basename>>/$basename/" $OUTPATH/template_cursor.svg > $OUTPATH/${basename}_cursor.svg
|
||||||
|
fi
|
||||||
|
done
|
|
@ -1,16 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# example:
|
|
||||||
# $ ./generate_tool_cursor.sh ../../toolicon/32x32/*@2x.png
|
|
||||||
|
|
||||||
for var in "$@"
|
|
||||||
do
|
|
||||||
basename=${var##*/}
|
|
||||||
basename=${basename%.png}
|
|
||||||
basename=${basename%@2x} # remove optional @2x suffix
|
|
||||||
if [ ! -f $basename@2x.png ]; then # always prefere hidpi version
|
|
||||||
sed "s/<<basename>>/$basename@2x/" template_cursor.svg > ${basename}_cursor.svg
|
|
||||||
else
|
|
||||||
sed "s/<<basename>>/$basename/" template_cursor.svg > ${basename}_cursor.svg
|
|
||||||
fi
|
|
||||||
done
|
|
Loading…
Reference in New Issue
Block a user