Skip to content

Commit

Permalink
Shellcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
andia89 committed Jan 10, 2016
1 parent eee2a33 commit e92186d
Showing 1 changed file with 52 additions and 54 deletions.
106 changes: 52 additions & 54 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

cd "$( dirname "${BASH_SOURCE[0]}" )"
cd "$( dirname "${BASH_SOURCE[0]}" )" || exit
RAWSVGS_LIGHT="src/light/svgs"
INDEX_LIGHT="src/light/cursor.theme"
RAWSVGS_DARK="src/dark/svgs"
Expand All @@ -11,24 +11,24 @@ ALIASES="src/cursorList"
echo -ne "Checking Requirements...\\r"

if [ ! -f $INDEX_LIGHT ] ; then
echo -e "\\nFAIL: '$INDEX_LIGHT' missing"
exit 1
echo -e "\\nFAIL: '$INDEX_LIGHT' missing"
exit 1
fi

if [ ! -f $INDEX_LIGHT ] ; then
echo -e "\\nFAIL: '$INDEX_DARK' missing"
exit 1
echo -e "\\nFAIL: '$INDEX_DARK' missing"
exit 1
fi


if ! type "inkscape" > /dev/null ; then
echo -e "\\nFAIL: inkscape must be installed"
exit 1
echo -e "\\nFAIL: inkscape must be installed"
exit 1
fi

if ! type "xcursorgen" > /dev/null ; then
echo -e "\\nFAIL: xcursorgen must be installed"
exit 1
echo -e "\\nFAIL: xcursorgen must be installed"
exit 1
fi
echo -e "Checking Requirements... DONE"

Expand All @@ -53,31 +53,31 @@ echo 'Making Folders... DONE';


for CUR in src/config/*.cursor; do
BASENAME=$CUR
BASENAME=${BASENAME##*/}
BASENAME=${BASENAME%.*}
BASENAME=$CUR
BASENAME=${BASENAME##*/}
BASENAME=${BASENAME%.*}

echo -ne "\033[0KGenerating simple cursor pixmaps... $BASENAME\\r"
echo -ne "\033[0KGenerating simple cursor pixmaps... $BASENAME\\r"

inkscape -w 32 -f $RAWSVGS_LIGHT/$BASENAME.svg -e "$DIR1X_LIGHT/$BASENAME.png" > /dev/null
inkscape -w 64 -f $RAWSVGS_LIGHT/$BASENAME.svg -e "$DIR2X_LIGHT/$BASENAME.png" > /dev/null
inkscape -w 32 -f $RAWSVGS_DARK/$BASENAME.svg -e "$DIR1X_DARK/$BASENAME.png" > /dev/null
inkscape -w 64 -f $RAWSVGS_DARK/$BASENAME.svg -e "$DIR2X_DARK/$BASENAME.png" > /dev/null
inkscape -w 32 -f $RAWSVGS_LIGHT/"$BASENAME".svg -e "$DIR1X_LIGHT/$BASENAME.png" > /dev/null
inkscape -w 64 -f $RAWSVGS_LIGHT/"$BASENAME".svg -e "$DIR2X_LIGHT/$BASENAME.png" > /dev/null
inkscape -w 32 -f $RAWSVGS_DARK/"$BASENAME".svg -e "$DIR1X_DARK/$BASENAME.png" > /dev/null
inkscape -w 64 -f $RAWSVGS_DARK/"$BASENAME".svg -e "$DIR2X_DARK/$BASENAME.png" > /dev/null
done
echo -e "\033[0KGenerating simple cursor pixmaps... DONE"



for i in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
do
echo -ne "\033[0KGenerating animated cursor pixmaps... $i / 24 \\r"
echo -ne "\033[0KGenerating animated cursor pixmaps... $i / 24 \\r"

inkscape -w 32 -f $RAWSVGS_LIGHT/progress-$i.svg -e "$DIR1X_LIGHT/progress-$i.png" > /dev/null
inkscape -w 64 -f $RAWSVGS_LIGHT/progress-$i.svg -e "$DIR2X_LIGHT/progress-$i.png" > /dev/null
inkscape -w 32 -f $RAWSVGS_DARK/progress-$i.svg -e "$DIR1X_DARK/progress-$i.png" > /dev/null
inkscape -w 64 -f $RAWSVGS_DARK/progress-$i.svg -e "$DIR2X_DARK/progress-$i.png" > /dev/null
inkscape -w 32 -f $RAWSVGS_LIGHT/progress-$i.svg -e "$DIR1X_LIGHT/progress-$i.png" > /dev/null
inkscape -w 64 -f $RAWSVGS_LIGHT/progress-$i.svg -e "$DIR2X_LIGHT/progress-$i.png" > /dev/null
inkscape -w 32 -f $RAWSVGS_DARK/progress-$i.svg -e "$DIR1X_DARK/progress-$i.png" > /dev/null
inkscape -w 64 -f $RAWSVGS_DARK/progress-$i.svg -e "$DIR2X_DARK/progress-$i.png" > /dev/null

inkscape -w 32 -f $RAWSVGS_LIGHT/wait-$i.svg -e "$DIR1X_LIGHT/wait-$i.png" > /dev/null
inkscape -w 32 -f $RAWSVGS_LIGHT/wait-$i.svg -e "$DIR1X_LIGHT/wait-$i.png" > /dev/null
inkscape -w 64 -f $RAWSVGS_LIGHT/wait-$i.svg -e "$DIR2X_LIGHT/wait-$i.png" > /dev/null
inkscape -w 32 -f $RAWSVGS_DARK/wait-$i.svg -e "$DIR1X_DARK/wait-$i.png" > /dev/null
inkscape -w 64 -f $RAWSVGS_DARK/wait-$i.svg -e "$DIR2X_DARK/wait-$i.png" > /dev/null
Expand All @@ -88,53 +88,51 @@ echo -e "\033[0KGenerating animated cursor pixmaps... DONE"

echo -ne "Generating cursor theme...\\r"
for CUR in src/config/*.cursor; do
BASENAME=$CUR
BASENAME=${BASENAME##*/}
BASENAME=${BASENAME%.*}
BASENAME=$CUR
BASENAME=${BASENAME##*/}
BASENAME=${BASENAME%.*}

ERR="$( xcursorgen -p build/light "$CUR" "$OUTPUT_LIGHT/cursors/$BASENAME" 2>&1 )"
ERR="$( xcursorgen -p build/light "$CUR" "$OUTPUT_LIGHT/cursors/$BASENAME" 2>&1 )"

if [[ "$?" -ne "0" ]]; then
echo "FAIL: $CUR $ERR"
fi
if [[ "$?" -ne "0" ]]; then
echo "FAIL: $CUR $ERR"
fi

ERR="$( xcursorgen -p build/dark "$CUR" "$OUTPUT_DARK/cursors/$BASENAME" 2>&1 )"
ERR="$( xcursorgen -p build/dark "$CUR" "$OUTPUT_DARK/cursors/$BASENAME" 2>&1 )"

if [[ "$?" -ne "0" ]]; then
echo "FAIL: $CUR $ERR"
fi


if [[ "$?" -ne "0" ]]; then
echo "FAIL: $CUR $ERR"
fi
done
echo -e "Generating cursor theme... DONE"


echo -ne "Generating shortcuts...\\r"
while read ALIAS ; do
FROM=${ALIAS% *}
TO=${ALIAS#* }
while read -r ALIAS ; do
FROM=${ALIAS% *}
TO=${ALIAS#* }
if [ -e "$OUTPUT_LIGHT/cursors/$FROM" ] ; then
continue
fi
ln -sf "$TO" "$OUTPUT_LIGHT/cursors/$FROM"
if [ -e "$OUTPUT_DARK/cursors/$FROM" ] ; then
continue
fi
ln -sf "$TO" "$OUTPUT_DARK/cursors/$FROM"
continue
fi
ln -sf "$TO" "$OUTPUT_LIGHT/cursors/$FROM"
if [ -e "$OUTPUT_DARK/cursors/$FROM" ] ; then
continue
fi
ln -sf "$TO" "$OUTPUT_DARK/cursors/$FROM"
done < $ALIASES
echo -e "\033[0KGenerating shortcuts... DONE"

exit

echo -ne "Copying Theme Index...\\r"
if ! [ -e "$OUTPUT_LIGHT/$INDEX_LIGHT" ] ; then
cp $INDEX_LIGHT "$OUTPUT_LIGHT/cursor.theme"
fi
if ! [ -e "$OUTPUT_DARK/$INDEX_DARK" ] ; then
cp $INDEX_DARK "$OUTPUT_DARK/cursor.theme"
fi
if ! [ -e "$OUTPUT_LIGHT/$INDEX_LIGHT" ] ; then
cp $INDEX_LIGHT "$OUTPUT_LIGHT/cursor.theme"
fi
if ! [ -e "$OUTPUT_DARK/$INDEX_DARK" ] ; then
cp $INDEX_DARK "$OUTPUT_DARK/cursor.theme"
fi
echo -e "\033[0KCopying Theme Index... DONE"


Expand Down

0 comments on commit e92186d

Please sign in to comment.