Skip to content

Instantly share code, notes, and snippets.

@BenKato151
Last active November 25, 2025 22:49
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"
@BenKato151
Copy link
Author

@SquiddyWins Danke dir!
Hab damit nun ein bisschen rumgetestet und du hattest zwar den richtigen Ansatz und dein Script ist auch an sich in Ordnung (bis auf ein paar kleine Logik-Fehler und Strukturierung, dennoch gut gemacht!).
Aber leider wird das auch nichts bringen, da die xcursor files in den Ordnern selbst skaliert werden müssten und dafür bräuchten wir die source Dateien des Artists... :/
Dennoch danke dir für die Bemühung uwu

@BenKato151
Copy link
Author

Okay, ich habe es jetzt hier so anpassen können, dass das script win2xcur mit ner PR patched, um es dann selbst zu builden...
Es funktioniert tatsächlich soweit, gibt aber leider nur ein kleines riesiges Problem: Wayland und sein cursor-shape-protocol
In x11/xwayland Anwendungen werden zwar die richtigen Größen angezeigt, bei Wayland Anwendungen aber nicht. Da wird es auf 24px (bei KDE Plasma zumindest) runterskaliert und, soweit ich das verstanden habe, auch in anderen Desktops mit Wayland.
git, curl und python sollten bei den meisten Distros schon vorinstalliert sein, aber bitte vorher prüfen.

Deswegen werde ich das obige Script nicht editieren und hier einfach für die, die damit noch ein bisschen rumspielen möchten, teilen:

#!/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: git, curl, python

# TODO: find usage for Altenate and handwriting, person; check for news on issue described below
# NOTE: Due to Wayland specific problems, the resized theme pack will not display correctly on wayland applications and will fallback to 24px.
# For x11/xwayland applications, it will work to an extend.
# Please look here for more information: https://blogs.kde.org/2024/10/09/cursor-size-problems-in-wayland-explained/ and https://blogs.kde.org/2025/01/12/kcursorgen-and-svg-cursors/


# Variables
ZIP_FILE="Ferdear_CustomCursor_himechii.zip"
PREFERRED_SIZE=24                                                               # Change to 32, 36, 48, 64... if you want to increase it. Default is: 24
THEME_NAME="Ferdear_CustomCursor_himechii_for_linux-${PREFERRED_SIZE}px"
UNPACKED_ZIP_PATH="tmp/Ferdear_CustomCursor_himechii"


# Prepare files
mkdir tmp/
unzip $ZIP_FILE -d tmp
mkdir -p $THEME_NAME/cursors/
touch $THEME_NAME/index.theme


# Download and apply custom win2xcur patch from https://github.com/quantum5/win2xcur/pull/23
git clone https://github.com/quantum5/win2xcur.git tmp/win2xcur
cd tmp/win2xcur
git switch --create size_scale-patch 8e71037
curl -L https://patch-diff.githubusercontent.com/raw/quantum5/win2xcur/pull/23.patch -o win2xcur-pr23.patch
git apply --index win2xcur-pr23.patch


# Prepare Python environment and build python package from patched win2xcur
python -m venv .venv
source .venv/bin/activate
pip install -U pip
pip install -r requirements.txt
pip install -e .
cd ../..


# Convert windows themes to xcursor using size from patched win2xcur
echo "Creating Theme pack for ${PREFERRED_SIZE}px..."
win2xcur $UNPACKED_ZIP_PATH/cursors/*.ani -o $THEME_NAME/cursors/ --size $PREFERRED_SIZE


# Symlink the cursor animations to the right action-name in linux
cd $THEME_NAME/cursors/

#ln -sf Altenate ???                                    # idk what this is for
ln -sf busy wait
ln -sf busy watch

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
ln -sf link hand1

ln -sf location center_ptr
ln -sf location cross

ln -sf move grabbing
ln -sf move fleur

ln -sf normal default
ln -sf normal left_ptr

ln -sf person target

ln -sf precision crosshair

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

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

ln -sf working progress


# Write index.theme
cd ..

cat <<EOF > "index.theme"
[Icon Theme]
Name=Ferdear_CustomCursor_himechii_for_linux-${PREFERRED_SIZE}px
Comment=Himechii Cursor theme by Ferdear resized for ${PREFERRED_SIZE}px
Comment[de]=Himechii Cursor theme von Ferdear angepasst für ${PREFERRED_SIZE}px
Inherits=Adwaita

EOF


# Create archive
cd ..
tar czf $THEME_NAME.tar.gz $THEME_NAME

# Cleanup
rm -rf tmp/ $THEME_NAME/

echo "Done"

Falls wer Verbesserungen hat oder Lösungsvorschläge, immer gerne her damit :3
Und bitte dann in einem markdown code-block mit ``` am Anfang und Ende

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