Skip to content

Instantly share code, notes, and snippets.

@BenKato151
Last active November 14, 2025 14:42
Show Gist options
  • Select an option

  • Save BenKato151/6c88a6506b31a13b378cd753901c4264 to your computer and use it in GitHub Desktop.

Select an option

Save BenKato151/6c88a6506b31a13b378cd753901c4264 to your computer and use it in GitHub Desktop.
Linux bash Script für das cursor-theme "Ferdear_CustomCursor_himechii"
#!/bin/bash
# PUT THIS FILE IN THE SAME FOLDER AS THE ZIP FILE YOU DOWNLOAD FROM HERE: https://www.patreon.com/posts/himechii-goal-138495273
# REQUIREMENTS INSTALL BEFORE USING THIS SCRIPT: win2xcur https://github.com/quantum5/win2xcur/
# TODO: find usage for Altenate and handwriting, maybe person; set different sizes for 24, 36, 48
# Prepare files
unzip Ferdear_CustomCursor_himechii.zip
mkdir -p Ferdear_CustomCursor_himechii_for_linux/cursors/
touch Ferdear_CustomCursor_himechii_for_linux/index.theme
# Convert windows themes to xcursor
win2xcur Ferdear_CustomCursor_himechii/cursors/*.ani -o Ferdear_CustomCursor_himechii_for_linux/cursors/
# Symlink the cursor animations to the right action-name in linux
cd Ferdear_CustomCursor_himechii_for_linux/cursors/
#ln -sf Altenate ??? # idk what this is for
ln -sf busy wait # finished
ln -sf busy watch # finished
ln -sf diagonia_1 bottom_right_corner
ln -sf diagonia_1 top_left_corner
ln -sf diagonia_1 nw-resize
ln -sf diagonia_1 se-resize
ln -sf diagonia_2 bottom_left_corner
ln -sf diagonia_2 top-right-corner
ln -sf diagonia_2 ne-resize
ln -sf diagonia_2 sw-resize
ln -sf horizontal size_hor
ln -sf horizontal sb_h_double_arrow
ln -sf horizontal ew-resize
ln -sf horizontal e-resize
ln -sf horizontal w-resize
ln -sf horizontal col-resize
ln -sf vertical size_ver
ln -sf vertical sb_v_double_arrow
ln -sf vertical ns-resize
ln -sf vertical n-resize
ln -sf vertical s-resize
ln -sf vertical row-resize
#ln -sf handwriting pencil # Idk for what this is???
#ln -sf handwriting pen
ln -sf help question_arrow
#ln -sf help help # is already set correctly
ln -sf link pointer # finished
ln -sf link hand1 # finished
ln -sf location center_ptr # finished
ln -sf location cross # finished
ln -sf move grabbing # finished
ln -sf move fleur # finished
ln -sf normal default # finished
ln -sf normal left_ptr # finished
ln -sf person target # finished
ln -sf precision crosshair # finished
ln -sf text xterm # finished
#ln -sf text text # is already set correctly
ln -sf unavailable no-drop # finished
ln -sf unavailable forbidden # finished
ln -sf unavailable not-allowed # finished
ln -sf working progress # finished
# Write index.theme
cd ..
cat > "index.theme" << 'EOF'
[Icon Theme]
Name=Ferdear_CustomCursor_himechii_for_linux
Comment=Himechii Cursor theme by Ferdear
Comment[de]=Himechii Cursor theme von Ferdear
Inherits=Adwaita
EOF
# Create archive
cd ..
tar czf Ferdear_CustomCursor_himechii_for_linux.tar.gz Ferdear_CustomCursor_himechii_for_linux/
# cleanup
rm -r Ferdear_CustomCursor_himechii/ Ferdear_CustomCursor_himechii_for_linux/
echo "done"
@SquiddyWins
Copy link

#!/bin/bash

PUT THIS FILE IN THE SAME FOLDER AS THE ZIP FILE YOU DOWNLOAD FROM HERE: https://www.patreon.com/posts/himechii-goal-138495273

REQUIREMENTS INSTALL BEFORE USING THIS SCRIPT: win2xcur https://github.com/quantum5/win2xcur/

TODO: find usage for Altenate and handwriting, maybe person; set different sizes for 24, 36, 48

Prepare files

unzip Ferdear_CustomCursor_himechii.zip
mkdir -p Ferdear_CustomCursor_himechii_for_linux/cursors/
#touch Ferdear_CustomCursor_himechii_for_linux/index.theme

Convert windows themes to xcursor

#win2xcur Ferdear_CustomCursor_himechii/cursors/.ani -o Ferdear_CustomCursor_himechii_for_linux/cursors/
win2xcur Ferdear_CustomCursor_himechii/cursors/
.ani -o Ferdear_CustomCursor_himechii_for_linux/

Symlink the cursor animations to the right action-name in linux

#cd Ferdear_CustomCursor_himechii_for_linux/cursors/
cd Ferdear_CustomCursor_himechii_for_linux/cursors

#ln -sf Altenate ???                                # idk what this is for

ln -sf busy wait # finished
ln -sf busy watch # finished

ln -sf diagonia_1 bottom_right_corner
ln -sf diagonia_1 top_left_corner
ln -sf diagonia_1 nw-resize
ln -sf diagonia_1 se-resize

ln -sf diagonia_2 bottom_left_corner
ln -sf diagonia_2 top-right-corner
ln -sf diagonia_2 ne-resize
ln -sf diagonia_2 sw-resize

ln -sf horizontal size_hor
ln -sf horizontal sb_h_double_arrow
ln -sf horizontal ew-resize
ln -sf horizontal e-resize
ln -sf horizontal w-resize
ln -sf horizontal col-resize

ln -sf vertical size_ver
ln -sf vertical sb_v_double_arrow
ln -sf vertical ns-resize
ln -sf vertical n-resize
ln -sf vertical s-resize
ln -sf vertical row-resize

#ln -sf handwriting pencil                          # Idk for what this is???
#ln -sf handwriting pen

ln -sf help question_arrow
#ln -sf help help # is already set correctly

ln -sf link pointer # finished
ln -sf link hand1 # finished

ln -sf location center_ptr # finished
ln -sf location cross # finished

ln -sf move grabbing # finished
ln -sf move fleur # finished

ln -sf normal default # finished
ln -sf normal left_ptr # finished

ln -sf person target # finished

ln -sf precision crosshair # finished

ln -sf text xterm # finished
#ln -sf text text # is already set correctly

ln -sf unavailable no-drop # finished
ln -sf unavailable forbidden # finished
ln -sf unavailable not-allowed # finished

ln -sf working progress # finished

cd ..

defining the cursor sizes

THEME="Ferdear_CustomCursor_himechii_for_linux"
SIZES=(24 32 48 64)

for size in "${SIZES[@]}"; do
SIZE_DIR="$THEME/${size}x${size}/cursors"
mkdir -p "$SIZE_DIR"
echo "Created size ${size}x${size}..."

for size in "${SIZES[@]}"; do
    SIZE_DIR="$THEME/${size}x${size}/cursors"
    mkdir -p "$SIZE_DIR"
    echo "Created size ${size}x${size}..."

    # Copies all .cursor/ .png-files
    for cursor in "$THEME/cursors/"*.cursor "$THEME/cursors/"*.png; do
        [ -e "$cursor" ] || continue
        cp "$cursor" "$SIZE_DIR/"
    done
done

done

Checks if the directory was set correctly

echo "Verzeichnisstruktur:"
find "$THEME" -type d
echo "Beinhaltete Dateien im ${size}x${size} Ordner:"
ls -1 "$THEME/${size}x${size}/cursors"

cd ..

Creates index.theme and adds the information into the file

INDEX_FILE="$THEME/index.theme"

dirs=""
for size in "${SIZES[@]}"; do
dirs+="${size}x${size}/cursors,"
done
dirs=${dirs%,} # removes the last comma

cat < "$INDEX_FILE"
[Icon Theme]
Name=MyCursorTheme
Comment=Automatisch erzeugtes Cursortheme
Inherits=default
Directories=$dirs
EOF

for size in "${SIZES[@]}"; do
cat <> "$INDEX_FILE"

[${size}x${size}/cursors]
Size=$size
Type=Fixed
EOF
done´´´

Adds the sizes into the index.theme file

#for size in "${SIZES[@]}"; do
#cat >> "$INDEX_FILE" <<EOF

#[${size}x${size}/cursors]
#Size=$size
#Type=Fixed
#EOF
#done

Create archive

tar czf Ferdear_CustomCursor_himechii_for_linux.tar.gz "$THEME"

cleanup

rm -r Ferdear_CustomCursor_himechii/ Ferdear_CustomCursor_himechii_for_linux/

echo "done"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment