mirror of
https://gitlab.com/ykkzde/posy-cursors
synced 2024-10-27 20:44:10 +00:00
113 lines
2.1 KiB
Bash
Executable File
113 lines
2.1 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
function buildWhite {
|
|
cd "$sourceWhite"
|
|
mkdir -p x1 x1_25 x1_5 x2
|
|
# generate cursors
|
|
BUILD="$sourceWhite"/../posy-white
|
|
OUTPUT="$BUILD"/cursors
|
|
ALIASES="$sourceWhite"/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=$themeWhite\n" > "$INDEX"
|
|
fi
|
|
echo -e "Generating Theme Index... DONE"
|
|
}
|
|
|
|
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"
|
|
}
|
|
|
|
sourceWhite=$PWD/White
|
|
themeWhite="Posy White"
|
|
|
|
sourceBlack=$PWD/Black
|
|
themeBlack="Posy Black"
|
|
|
|
buildWhite
|
|
buildBlack
|