How to convert Windows cursor to Linux xcursor


favorited: true
title: How to convert Windows cursor to Linux xcursor
created: ‘2024-10-07T03:01:32.675Z’
modified: ‘2025-03-24T17:07:27.978Z’

How to convert Windows cursor to Linux xcursor

Warning: This article has specificity, and I am not found x11 cursors theme standard, maybe you will find some issues

dirctory

Windows cursor theme structure

Now, we get a Windows cursor theme.
The Windows cursor theme structure like:

❯ ll
total 2.6M
-rw-r--r-- 1 lingu lingu  27K 1026 14:01  Alternate.ani
-rw-r--r-- 1 lingu lingu  27K 1026 14:01  Busy.ani
-rw-r--r-- 1 lingu lingu  27K 1026 14:01  Diagonal1.ani
-rw-r--r-- 1 lingu lingu  27K 1026 14:01  Diagonal2.ani
-rw-r--r-- 1 lingu lingu  27K 1026 14:01  Handwriting.ani
-rw-r--r-- 1 lingu lingu  27K 1026 14:01  Help.ani
-rw-r--r-- 1 lingu lingu  27K 1026 14:01  Horizontal.ani
-rw-r--r-- 1 lingu lingu 3.0K 1026 14:01  install.inf
-rw-r--r-- 1 lingu lingu  27K 1026 14:01  Link.ani
-rw-r--r-- 1 lingu lingu  27K 1026 14:01  Move.ani
-rw-r--r-- 1 lingu lingu  27K 1026 14:01  Normal.ani
-rw-r--r-- 1 lingu lingu  27K 1026 14:01  Person.ani
-rw-r--r-- 1 lingu lingu  27K 1026 14:01  Pin.ani
-rw-r--r-- 1 lingu lingu  27K 1026 14:01  Precision.ani
-rw-r--r-- 1 lingu lingu  27K 1026 14:01  Text.ani
-rw-r--r-- 1 lingu lingu  27K 1026 14:01  Unavailable.ani
-rw-r--r-- 1 lingu lingu  27K 1026 14:01  Vertical.ani
-rw-r--r-- 1 lingu lingu  27K 1026 14:01  Working.ani

We can see Windows cursor filetype is .ani.
The install.inf is a install script, It donesn’t work on linux, only careful the .ani files
Ofcause, the .cur also Windows cursor filetype.
How to convert .ani to .xcursor
We can use the win2xcur.

install win2xcur

pip install win2xcur
win2xcur *.ani output_dir

The output_dir like

ll
-rw-r--r-- 1 lingu lingu 49K  23 00:58 ./crosshair
-rw-r--r-- 1 lingu lingu 49K  23 00:58 ./default
-rw-r--r-- 1 lingu lingu 49K  23 00:58 ./dnd-move
-rw-r--r-- 1 lingu lingu 49K  23 00:58 ./help
-rw-r--r-- 1 lingu lingu 49K  23 00:58 ./not-allowed
-rw-r--r-- 1 lingu lingu 49K  23 00:58 ./pencil
-rw-r--r-- 1 lingu lingu 49K  23 00:58 ./pointer
-rw-r--r-- 1 lingu lingu 49K  23 00:58 ./progress
-rw-r--r-- 1 lingu lingu 49K  23 00:58 ./size_bdiag
-rw-r--r-- 1 lingu lingu 49K  23 00:58 ./size_fdiag
-rw-r--r-- 1 lingu lingu 49K  23 00:58 ./size_hor
-rw-r--r-- 1 lingu lingu 49K  23 00:58 ./size_ver
-rw-r--r-- 1 lingu lingu 49K  23 00:58 ./text
-rw-r--r-- 1 lingu lingu 49K  23 00:58 ./up-arrow
-rw-r--r-- 1 lingu lingu 49K  23 00:58 ./wait

More information about win2xcur in here

xcursor theme structure

You can open a xcursor theme on you Linux machine.
Linux will save the cursor theme in ~/.icons(user) and /usr/share/incons(system) and so on.
Follow me:

cd ~/.icons
# choose you favorite cursor theme than input ll
# In here I use "Chroma-Black-M"
lingu@lingu-debian ~/.icons (master) 
❯ tree Chroma-Black-M/
Chroma-Black-M/
├── cursors
│   ├── bottom_left_corner -> size_bdiag
│   ├── bottom_right_corner -> size_fdiag
│   ├── circle -> not-allowed
│   ├── closedhand -> dnd-move
│   ├── cross -> crosshair
│   ├── crossed_circle -> not-allowed
│   ├── crosshair
│   ├── default
│   ├── dnd-move
│   ├── dnd-none -> dnd-move
│   ├── e-resize -> size_hor
│   ├── ew-resize -> size_hor
│   ├── fleur -> dnd-move
│   ├── grabbing -> dnd-move
│   ├── half-busy -> pointer
│   ├── h_double_arrow -> size_hor
│   ├── help
│   ├── ibeam -> text
│   ├── left_ptr -> default
│   ├── left_ptr_watch -> progress
│   ├── left_side -> size_hor
│   ├── move -> dnd-move
│   ├── ne-resize -> default
│   ├── nesw-resize -> default
│   ├── not-allowed
│   ├── n-resize -> size-ver
│   ├── ns-resize -> size-ver
│   ├── nw-resize -> default
│   ├── nwse-resize -> default
│   ├── pencil
│   ├── pointer
│   ├── progress
│   ├── right_side -> size_hor
│   ├── sb_h_double_arrow -> size_hor
│   ├── sb_v_double_arrow -> size-ver
│   ├── se-resize -> default
│   ├── size-bdiag -> default
│   ├── size_bdiag
│   ├── size-fdiag -> default
│   ├── size_fdiag
│   ├── size-hor -> default
│   ├── size_hor
│   ├── size-ver -> default
│   ├── size_ver
│   ├── s-resize -> size-ver
│   ├── sw-resize -> default
│   ├── text
│   ├── top_left_arrow -> default
│   ├── top_left_corner -> size_fdiag
│   ├── top_right_corner -> size_bdiag
│   ├── top_side -> size-ver
│   ├── up-arrow
│   ├── v_double_arrow -> size-ver
│   ├── wait
│   ├── watch -> wait
│   ├── w-resize -> size_hor
│   └── xterm -> text
└── index.theme

2 directories, 58 files

Windows cursor theme and xcursor theme different point

As you can see. The xcursor themes have more files then The Windows cursor themes.
And xcursor theme have many symbol link.
What the symbol linked, let’s see the normal files.

lingu@lingu-debian ~/.icons/Chroma-Black-M/cursors (master)find -type f
./size_fdiag
./progress
./wait
./dnd-move
./up-arrow
./help
./pencil
./size_hor
./size_bdiag
./text
./not-allowed
./default
./pointer
./crosshair
./size_ver
lingu@lingu-debian ~/.icons/Chroma-Black-M/cursors (master)find -type f | wc
     15      15     157

These files are important. Let me replay the Windows cursor theme

❯ ll
total 2.6M
-rw-r--r-- 1 lingu lingu  27K 1026 14:01  Alternate.ani
-rw-r--r-- 1 lingu lingu  27K 1026 14:01  Busy.ani
-rw-r--r-- 1 lingu lingu  27K 1026 14:01  Diagonal1.ani
-rw-r--r-- 1 lingu lingu  27K 1026 14:01  Diagonal2.ani
-rw-r--r-- 1 lingu lingu  27K 1026 14:01  Handwriting.ani
-rw-r--r-- 1 lingu lingu  27K 1026 14:01  Help.ani
-rw-r--r-- 1 lingu lingu  27K 1026 14:01  Horizontal.ani
-rw-r--r-- 1 lingu lingu  27K 1026 14:01  Link.ani
-rw-r--r-- 1 lingu lingu  27K 1026 14:01  Move.ani
-rw-r--r-- 1 lingu lingu  27K 1026 14:01  Normal.ani
-rw-r--r-- 1 lingu lingu  27K 1026 14:01  Person.ani
-rw-r--r-- 1 lingu lingu  27K 1026 14:01  Pin.ani
-rw-r--r-- 1 lingu lingu  27K 1026 14:01  Precision.ani
-rw-r--r-- 1 lingu lingu  27K 1026 14:01  Text.ani
-rw-r--r-- 1 lingu lingu  27K 1026 14:01  Unavailable.ani
-rw-r--r-- 1 lingu lingu  27K 1026 14:01  Vertical.ani
-rw-r--r-- 1 lingu lingu  27K 1026 14:01  Working.ani

# there are 17 .ani files

Maybe you will ask: Why the files number is not equle?
Yes, I don’t konw why. But Person.ani and Pin.ani maybe fifth wheel.
Replay our converted.

-rw-r--r-- 1 lingu lingu 49K  23 00:58 ./crosshair
-rw-r--r-- 1 lingu lingu 49K  23 00:58 ./default
-rw-r--r-- 1 lingu lingu 49K  23 00:58 ./dnd-move
-rw-r--r-- 1 lingu lingu 49K  23 00:58 ./help
-rw-r--r-- 1 lingu lingu 49K  23 00:58 ./not-allowed
-rw-r--r-- 1 lingu lingu 49K  23 00:58 ./pencil
-rw-r--r-- 1 lingu lingu 49K  23 00:58 ./pointer
-rw-r--r-- 1 lingu lingu 49K  23 00:58 ./progress
-rw-r--r-- 1 lingu lingu 49K  23 00:58 ./size_bdiag
-rw-r--r-- 1 lingu lingu 49K  23 00:58 ./size_fdiag
-rw-r--r-- 1 lingu lingu 49K  23 00:58 ./size_hor
-rw-r--r-- 1 lingu lingu 49K  23 00:58 ./size_ver
-rw-r--r-- 1 lingu lingu 49K  23 00:58 ./text
-rw-r--r-- 1 lingu lingu 49K  23 00:58 ./up-arrow
-rw-r--r-- 1 lingu lingu 49K  23 00:58 ./wait

# there are also 15 files

How to rename files to be xcursor standard?

language expressionWindow cursor filexcursor file
NormalNormal.anidefault
When you drag windowMove.anidnd-move
When cursor on input-boxText.anitext
When cursor on helpHelp.anihelp
When cursor on wait windowBusy.aniwait
Precision.anicrosshair
Handwriting.anipencil
When cursor on linksLink.anipointer
Working.aniprogress
Unavailable.aninot-allowed
Alternate.aniup-arrow
Horizontal.anisize_hor
Vertical.anisize_ver
Diagonal1.anisize_fdiag
Diagonal2.anisize_bdiag

Link & rename files

This is a script to help you do that: https://github.com/Hello-lingu/win2xcur
NOTE: '-' and '_' is different
Now we have basic cursors, then make the symbol links.
Help:ln -s TARGET LINK_NAME can create a symbol link LINK_NAME point TAEGET

language expressionWindow cursor filexcursor filesymbol links
NormalNormal.anidefaultleft_ptr
When cursor on input-boxText.anitextibeam xterm
When cursor on helpHelp.anihelp5c6cd98b3f3ebcb1f9c7f1c20463040
When cursor on wait windowBusy.aniwaitwatch
Precision.anicrosshaircross
Handwriting.anipencildraft
When cursor on linksLink.anipointerhand1 hand2 half-busy pointing_hand e29285e634086352946a0e7090d73106 9d800788f1b08800ae810202380a0822
Working.aniprogressleft_ptr_watch 08e8e1c95fe2fc01f976f1e063a24ccd 3ecb610c1bf2410f44200f48c40d3599
Unavailable.aninot-allowedcircle crossed_circle 03b6e0fcb3499374a867c041f52298f0
Alternate.aniup-arrow
Horizontal.anisize_hore-resize ew-resize h_double_arrow left_side right_side sb_h_double_arrow w-resize split_h col-resize
Vertical.anisize_versplit_v n-resize ns-resize row-resize s-resize v_double_arrow 00008160000006810000408080010102
When cursor on window bottom-right or top-leftDiagonal1.anisize_fdiagbottom_right_corner top_left_cornersw-resize nw-resize nwse-resize se-resize
When cursor on window bottom-left or top-rightDiagonal2.anisize_bdiagbottom_left_corner top_right_cornerne-resize ne-resize nese-resize sw-resize
When you drag windowMove.anidnd-moveclosedhand dnd-none fleur grabbing move all-scroll size_all 4498f0e0c1937ffe01fd06f973665830 9081237383d90e509aa00f00170e968

Make sure it’s correct

theme_name/
|-- cursors
|   |-- your cursor files
|-- index.theme

Now we must write a index.theme.
index.theme

[Icon Theme]
Name=your cursor name
Comment=your cursor descriptor

Test

Now, let me test the cursor theme.

kde

  • start system setting
  • into Appearance
  • into cursor
  • compress your cursor theme to be .tar.gz
  • click install from file...
  • select your cursor theme package(.tar.gz or .zip)

maybe all Linux released?

  • copy or move your cursor theme to ~/.icons
  • pleaseure your theme structure is right
  • then your can see cursor theme on your settings

If everything is fine, you can pleasantly use your favorite cursor.

More information about xcursor

my environment

Debian12 Kde plasma conda python3.9 x11
Cursor themes - ArchWiki
Create your own mouse cursor theme | Developer
charakterziffer/cursor-toolbox: Tools to create an X11 cursor theme out of an SVG file

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值