1
0
mirror of https://gitlab.com/ykkzde/posy-cursors synced 2024-10-27 20:44:10 +00:00
archive-posy-cursors/build.sh

223 lines
4.4 KiB
Bash
Raw Normal View History

2019-10-25 08:28:11 +00:00
#!/bin/bash
2019-10-25 17:16:02 +00:00
function buildWhite {
cd "$sourceWhite"
2019-10-25 08:28:11 +00:00
mkdir -p x1 x1_25 x1_5 x2
# generate cursors
2019-10-25 17:16:02 +00:00
BUILD="$sourceWhite"/../posy-white
2019-10-25 08:28:11 +00:00
OUTPUT="$BUILD"/cursors
2019-10-25 17:16:02 +00:00
ALIASES="$sourceWhite"/cursorList
2019-10-25 08:28:11 +00:00
if [ ! -d "$BUILD" ]; then
mkdir "$BUILD"
fi
if [ ! -d "$OUTPUT" ]; then
mkdir "$OUTPUT"
fi
echo -ne "Generating cursor theme...\\r"
for CUR in config/*.cursor; do
BASENAME="$CUR"
BASENAME="${BASENAME##*/}"
BASENAME="${BASENAME%.*}"
xcursorgen "$CUR" "$OUTPUT/$BASENAME"
done
echo -e "Generating cursor theme... DONE"
cd "$OUTPUT"
#generate aliases
echo -ne "Generating shortcuts...\\r"
while read ALIAS; do
FROM="${ALIAS#* }"
TO="${ALIAS% *}"
if [ -e $TO ]; then
continue
fi
ln -sr "$FROM" "$TO"
done < "$ALIASES"
echo -e "Generating shortcuts... DONE"
cd "$PWD"
echo -ne "Generating Theme Index...\\r"
INDEX="$OUTPUT/../index.theme"
if [ ! -e "$OUTPUT/../$INDEX" ]; then
touch "$INDEX"
2019-10-25 17:16:02 +00:00
echo -e "[Icon Theme]\nName=$themeWhite\n" > "$INDEX"
2019-10-25 08:28:11 +00:00
fi
echo -e "Generating Theme Index... DONE"
}
2019-10-25 17:16:02 +00:00
function buildBlack {
cd "$sourceBlack"
mkdir -p x1 x1_25 x1_5 x2
# generate cursors
BUILD="$sourceBlack"/../posy-black
OUTPUT="$BUILD"/cursors
ALIASES="$sourceBlack"/cursorList
if [ ! -d "$BUILD" ]; then
mkdir "$BUILD"
fi
if [ ! -d "$OUTPUT" ]; then
mkdir "$OUTPUT"
fi
echo -ne "Generating cursor theme...\\r"
for CUR in config/*.cursor; do
BASENAME="$CUR"
BASENAME="${BASENAME##*/}"
BASENAME="${BASENAME%.*}"
xcursorgen "$CUR" "$OUTPUT/$BASENAME"
done
echo -e "Generating cursor theme... DONE"
cd "$OUTPUT"
#generate aliases
echo -ne "Generating shortcuts...\\r"
while read ALIAS; do
FROM="${ALIAS#* }"
TO="${ALIAS% *}"
if [ -e $TO ]; then
continue
fi
ln -sr "$FROM" "$TO"
done < "$ALIASES"
echo -e "Generating shortcuts... DONE"
cd "$PWD"
echo -ne "Generating Theme Index...\\r"
INDEX="$OUTPUT/../index.theme"
if [ ! -e "$OUTPUT/../$INDEX" ]; then
touch "$INDEX"
echo -e "[Icon Theme]\nName=$themeBlack\n" > "$INDEX"
fi
echo -e "Generating Theme Index... DONE"
}
2019-10-25 08:28:11 +00:00
2019-10-25 19:03:01 +00:00
function buildBlackTiny {
cd "$sourceBlackTiny"
mkdir -p x1 x1_25 x1_5 x2
# generate cursors
BUILD="$sourceBlackTiny"/../posy-black-tiny
OUTPUT="$BUILD"/cursors
ALIASES="$sourceBlack"/cursorList
if [ ! -d "$BUILD" ]; then
mkdir "$BUILD"
fi
if [ ! -d "$OUTPUT" ]; then
mkdir "$OUTPUT"
fi
echo -ne "Generating cursor theme...\\r"
for CUR in config/*.cursor; do
BASENAME="$CUR"
BASENAME="${BASENAME##*/}"
BASENAME="${BASENAME%.*}"
xcursorgen "$CUR" "$OUTPUT/$BASENAME"
done
echo -e "Generating cursor theme... DONE"
cd "$OUTPUT"
#generate aliases
echo -ne "Generating shortcuts...\\r"
while read ALIAS; do
FROM="${ALIAS#* }"
TO="${ALIAS% *}"
if [ -e $TO ]; then
continue
fi
ln -sr "$FROM" "$TO"
done < "$ALIASES"
echo -e "Generating shortcuts... DONE"
cd "$PWD"
echo -ne "Generating Theme Index...\\r"
INDEX="$OUTPUT/../index.theme"
if [ ! -e "$OUTPUT/../$INDEX" ]; then
touch "$INDEX"
echo -e "[Icon Theme]\nName=$themeBlackTiny\n" > "$INDEX"
fi
echo -e "Generating Theme Index... DONE"
}
function buildWhiteTiny {
cd "$sourceWhiteTiny"
mkdir -p x1 x1_25 x1_5 x2
# generate cursors
BUILD="$sourceWhiteTiny"/../posy-white-tiny
OUTPUT="$BUILD"/cursors
ALIASES="$sourceWhiteTiny"/cursorList
if [ ! -d "$BUILD" ]; then
mkdir "$BUILD"
fi
if [ ! -d "$OUTPUT" ]; then
mkdir "$OUTPUT"
fi
echo -ne "Generating cursor theme...\\r"
for CUR in config/*.cursor; do
BASENAME="$CUR"
BASENAME="${BASENAME##*/}"
BASENAME="${BASENAME%.*}"
xcursorgen "$CUR" "$OUTPUT/$BASENAME"
done
echo -e "Generating cursor theme... DONE"
cd "$OUTPUT"
#generate aliases
echo -ne "Generating shortcuts...\\r"
while read ALIAS; do
FROM="${ALIAS#* }"
TO="${ALIAS% *}"
if [ -e $TO ]; then
continue
fi
ln -sr "$FROM" "$TO"
done < "$ALIASES"
echo -e "Generating shortcuts... DONE"
cd "$PWD"
echo -ne "Generating Theme Index...\\r"
INDEX="$OUTPUT/../index.theme"
if [ ! -e "$OUTPUT/../$INDEX" ]; then
touch "$INDEX"
echo -e "[Icon Theme]\nName=$themeWhiteTiny\n" > "$INDEX"
fi
echo -e "Generating Theme Index... DONE"
}
2019-10-25 17:16:02 +00:00
sourceWhite=$PWD/White
themeWhite="Posy White"
2019-10-25 08:28:11 +00:00
2019-10-25 17:16:02 +00:00
sourceBlack=$PWD/Black
themeBlack="Posy Black"
2019-10-25 08:28:11 +00:00
2019-10-25 19:03:01 +00:00
sourceWhiteTiny=$PWD/WhiteTiny
themeWhiteTiny="Posy White Tiny"
sourceBlackTiny=$PWD/BlackTiny
themeBlackTiny="Posy Black Tiny"
2019-10-25 17:16:02 +00:00
buildWhite
buildBlack
2019-10-25 19:03:01 +00:00
buildWhiteTiny
buildBlackTiny