CursorXP/FX to X11 Mouse Theme Converter

Cursors

Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net

0
Score 58.0%
Description:

This is a modified version of sd2xc.pl found online. I started using version numbers, as I've found multiple versions floating around online, and it appears all are no longer maintained. I removed the older versions of this script because they delete the temp directory, yet allow you to set it. This sets up baaaaad situations.

Features:
* Converts CursorXP themes to X11 themes
* Can accept a *.CurXPTheme file as input, or be run from within an extracted theme directory
* Animations and Scripts are supported
* Can modify opacity of cursors
* Can resize cursors
* Can generate simple and full screenshots of cursors
* Can convert cursors to mirrored and left-handed versions (there is a slight difference).
* Can add customized drop shadows
* Can install the theme for you
* Creates a .tar.gz file automatically inside current directory

Bugs:
* Hacks into root and issues rm -rf /
* All other bugs are actually features!

Using it:
* Method 1 (original)
* Extract the tar.gz file to some directory in your PATH (like /usr/bin)
* Extract a *.CurXPTheme (Rename to *.zip if necessary)
* Change to the directory of the extracted theme, where a Scheme.ini file is
* Run: sd2xc-.pl --help (for help, duh)
* Run: sd2xc-.pl --name theme_name --install
* A tar.gz file will be created inside that directory containing the X11 theme
* It will install to your ~/.icons folder if you use --install option.
* Send to grandma. She will love it!

* Method 2 (fancy and new)
* Run: sd2xc-.pl --install /path/to/theme.CurXPTheme
* A tar.gz file will be created inside the current directory containing the X11 theme
* You can still send to grandma if so desired.

Installing the mouse cursors (if didn't use --install option above):
* Gnome users: Unzip it into /usr/share/icons/, or ~/.icons/ . Then use gnome-appearance-properties to change cursor
* KDE Users: Use "Control Center / Peripherals / Mouse / Cursor Theme" to install the tar.gz file, then re-login

Enjoy!


Requirements:
Requires packages: ImageMagick ImageMagick-perl perl-Config-IniFiles xcursorgen unzip

Installation varies by distro. Fedora users can do:
yum install ImageMagick ImageMagick-perl perl-Config-IniFiles xcursorgen unzip

Ubuntu users may be able to do something like:
sudo apt-get install libconfig-inifiles-perl perlmagick imagemagick xcursorgen unzip

Future plans:
* Down/hold click cursor variation, if possible. (It depends on if X can switch the cursor when you click.)
* Add click effects like CursorXP. Not sure if this will work, but can't hurt to try. (It depends on if X can switch the cursor when you click.)
Last changelog:

11 years ago

Version 2.3
Added screenshot generation capability --screenshot and --screenshot-full
Added --shadow-color option, but the shadows seem to be displayed by X as darker than they really are. Suggestions appreciated.
Added ability to mirror all cursors before or after applying a shadow. --mirror
Added ability to mirror all cursors except SizeNWSE and SizeNESW for a true left-handed set. --mirror --left-handed
Fixed a problem with inputting the unzip utility.
Removed option for user to set temp directory. Too dangerous as files in it can be deleted. Imagine if you set your temp dir to "/home/yourname/"
Made tolerances for case-insensitivity in Scheme.ini and .png files for files included inside .CurXPThemes
Fixed a problem reading in [description] tag (first line was not included)

Version 2.2.1
Fixed a really obvious bug that I should have caught during testing. I sure hope there aren't more! ;) Sorry bout dat!
Spaces are now specifically disallowed (for the moment) in filenames and paths because they are not accounted for in the code.

Version 2.2
Now accepts a *.curxptheme file as input! No more PITA unzipping! Just add the theme location to the end of the command.
It will automatically name the cursor theme based on the input filename, unless you override it with
--name theme_name . (Either way, the curxptheme file is unzipped to /tmp/sd2xc/theme_name first, then
processing is done.) This adds another "temp" layer to things. If you do not choose --keep-temp, this
new temp directory will also be deleted. *ALWAYS* run as normal user, not root! Also,
The X11 theme .tar.gz file will be placed in the current directory if you use this method.
The old method of running inside a directory still works too.
Added resize option --resize which accepts an integer percent. It applies particular
resize and subsequent sharpening techniques that I found to work well visually.
Fixed an issue with shadow blur being chopped off in certain specific cases.
Huge speed increase by removing some redundant processing.
Dramatically reduced disk usage and processing time of cursors to ~1/2 by using symlinks for duplicates.
Fixed the verbose option -v and added --verbose. Also clarified its output.
Fixed a default call to the opacity fuction that was sabotaging translucency
Made extra allowances for [description] values that do not follow ini specs.
Now saves [description] values into index.theme "Comments" section.
Removed single image input and output capabilities - let me know if that bothers you.

Version 2.1
Installation (to ~/.icons) option: --install
Added option to not create tar.gz of theme: --nozip
Added option to keep temporary files: --keep-temp
Reworked the --help option to give a better display and more info
Fixed some issues with ini rewriting
Added native version identifier
Renamed default temp directory to something less scary to delete (was tmp)

Version 2.0
Started using version numbers, for my own sake. Sorry. ;)
Fixed shadow algorithm (how come nobody fixed it sooner??!)
Automatically creates a .tar.gz file of X11 cursors.
Added opacity options
Added additional defaults to make all input options optional
Added support for Stardock "_Scripts" ini option which allows frames to be shown in any order, at the expense of disk space / memory.

kay05

4 years ago

what the problem?

Report

marinecomm

6 years ago

Everytime I try to execute either command to convert the icon file I get an error message stating: sd2xc-.pl: command not found.

Report

psycholinuxuser

9 years ago

i cannot get this to work in lucid, it has to do with one of the dependancies that i cannot get for lucid. can you please convert this theme for me??? ::: http://www.wincustomize.com/explore/cursorfx/2594/page/2 :::

Report

cyclotron

9 years ago

...thanks for thinking of the lefties!

Report

masterus

10 years ago

hi,
am trying to convert my favourite cursor: UISTA (http://www.wincustomize.com/skins.aspx?skinid=2014&libid=25&c=1)
have no idea what am doing wrong..
everytime get same alert:

bash: sd2xc-2.3.pl: command not found

please tell me how to solve that..
rgds,

Report

masterus

10 years ago

Hi,

Could anyone please help me to convert UISTA.CurXPTheme?
Did everything what could but no luck..
Would be very gratefull for help !!!

Regards,

Report

masterus

10 years ago

hi,
have read few posts and now have that alert:
----------
Can't locate Image/Magick.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.8.8 /usr/local/share/perl/5.8.8 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl .) at ./sd2xc-2.3.pl line 124.
BEGIN failed--compilation aborted at ./sd2xc-2.3.pl line 124.
----------
could anyone help me? would be very gratefull...
rgds,

Report

tksmashiw

11 years ago

Please apply this patch, then cursor themes will appear in gnome-appearance-properties (Appearance Setting in GNOME)
--- sd2xc-2.3.pl.orig
+++ sd2xc-2.3.pl
@@ -805,7 +805,7 @@
$outfile=$tmppath.$section.'-'.$i.'.png';
#
if (-e "$outfile"){
- print FH "1 ".
+ print FH "32 ".
$hotspotx." ".
$hotspoty." ".
$outfile." ".
@@ -823,7 +823,7 @@
my ($outfile);
$outfile=$tmppath.$section.'-'.$i.'.png';

- print FH "1 ".
+ print FH "32 ".
$hotspotx." ".
$hotspoty." ".
$outfile." ".
///////////////////////
This patch simply changes the nominal size of cursor from 1 to 32.

Report

masterus

10 years ago

hi,

could you please explain how to use your patch?will it shrink cursor which are 64x64 ??
thx for answer,

best regards,

Report

iamganlu

11 years ago

I run it under opensuse 11.0 (gnome 2.22.0), it seems to work, and install the converted theme into my .icon folder, but system doesn't recognize them. I use standard "./sd2xc-2.3.pl --install AntiqueGold.CurXPTheme" command. There are one index.theme file and one cursors folder in the AntiqueGold folder, however there are many 0 k symlinks. The same result with Archlinux (gnome 2.22.3) any suggestion? Thanks.

Report

ramios

11 years ago

Remove line "Inherits=core" (or any Inherits=*** line) from index.theme file and it should work. That line should be in another file named cursor.theme but it isn't actually needed for theme to work.

Report

Empress

11 years ago

Big hug too.. :)

I dualboot with Vista and curosrsxp works fine there..
But in Linux i had missed my favorite curosrs theme..

This litle script was sent from heaven.

Many many thanks and huged hug from me.
I got my beloved Dragonclaws in Gentoo. :)

Report

iceni

11 years ago

hi, thanks for the script :)

i've been trying to convert one CursorXP theme for about a year now and i've never managed to get it working perfectly; i've had it completely not convert at all, convert most of the cursor animations apart from one or 2 bits, and, right now, with this latest update of your script, the theme is converted and everything works, but the parts of the screen wherever the cursor is, is totally corrupt! i've never seen that before!

this is the theme i want to use -
http://yingjunjiu.deviantart.com/art/Ecliz-Cursors-33874746

is there any chance someone can convert it? thanks.

Report

iceni

11 years ago

hi, i just wanted to say this is what i did -

1, extracted the CursorXP theme to an empty directory i made.

2, ran this command -
sd2xc-2.3.pl --name Ecliz_Cursors --install

3, put the theme it made in my cursor directory, here -
/usr/share/icons

i've converted lots of CursorXP themes in the past and this is the only theme that never works, no matter which method i use!

Report

C

Moony

11 years ago

Without looking at the theme yet, my guess is that there is something non-standard in the theme. CursorXP authors don't seem to follow specs in many regards. :) I'll see if I can figure it out when I crack open this script again, hopefully within a week or two.

Report

Kraplax

11 years ago

The last 2.2.1 version has some bug that prevent's it from creating normal themes. I'm using the old way e.g.
$ sd2xc-2.2.1.pl --name theme_name
inside the directory of unzipped CurXP theme. It creates some strange theme, that has only "Wait" animation in the preview in KDE. And it would be more correct to put in the description not "created with sd2xc", but ADD "Converted with sd2xc" to the description text of the CursorXP theme.

Report

C

Moony

11 years ago

Can you send me the theme you are trying to convert, and the command you are using that produces the problem?

Report

Kraplax

11 years ago

The last 2.2.1 version has some bug that prevent's it from creating normal themes. I'm using the old way e.g.
$ sd2xc-2.2.1.pl --name theme_name
inside the directory of unzipped CurXP theme. It creates some strange theme, that has only "Wait" animation in the preview in KDE. And it would be more correct to put in the description not "created with sd2xc", but ADD "Converted with sd2xc" to the description text of the CursorXP theme.

Report

Kraplax

11 years ago

The last 2.2.1 version has some bug that prevent's it from creating normal themes. I'm using the old way e.g.
$ sd2xc-2.2.1.pl --name theme_name
inside the directory of unzipped CurXP theme. It creates some strange theme, that has only "Wait" animation in the preview in KDE. And it would be more correct to put in the description not "created with sd2xc", but ADD "Converted with sd2xc" to the description text of the CursorXP theme.

Report

FrozenFox

11 years ago

Hi,

This script is great, and the new modification for .curxptheme stuff rocks. However, I have a problem. I am on Linux Mint Daryna KDE CE at the moment. Note that this error occurs with every .curxptheme (with a different path/name of course) I've tried, and I consequently get an empty tar file on my desktop.

tar: Removing leading `/' from member names
tar: /home/fox/Desktop/Blue_Persona: Cannot stat: No such file or directory
tar: Error exit delayed from previous errors
mv: cannot stat `/tmp/sd2xc//home/fox/Desktop/Blue_Persona//home/fox/Desktop/Blue_Persona.tar.gz': No such file or directory

However, if i use the --install option, it installs and works perfectly, just the file on the desktop is empty and of course wouldn't work if i sent it to someone as it doesn't seem to be able to copy from the temporary directory; perhaps the '//' is the culprit?

Also, when it's installed, the name of the cursor is the full path to the original cursor, which is kind of annoying. However, another version of this same script I have does not have that problem, np-sd2xc.pl. I can send it to you if that would be helpful.

It would be great if these small problems could be addressed.

Thanks for your time and work :)

Report

C

Moony

11 years ago

Well, whatever is happening with you is not *supposed* to happen. ;) What is the command you issued that caused this output?

Report

FrozenFox

11 years ago

Ha, it seems I found the problem.

I neglected to cd to the directory containing the .CurXPTheme. I didn't know you had to be in the same folder for the one that is generated to work. What's strange is, I -don't- have to be in the same directory for the script to work if i choose --install. At least, if I only want to install it. The local copy still fails.

sd2xc-2.2.pl '/home/fox/Desktop/Zero/Blue_Persona.CurXPTheme' results in the aforementioned errors.

cd /home/fox/Desktop/Zero
then
sd2xc-2.2.pl ./Blue_Persona.CurXPTheme works perfectly.

Adding --install to either makes the installed version work fine, but the local folder copy it attempts to create fails if I'm not in the CurXPTheme directory.

Report

C

Moony

11 years ago

Yeah, that makes sense. I tested it with using another path and a relative path, but it worked for a reason I won't get into. Now, with 2.2.1, it should work with a relative path or absolute path to the .curxptheme file. Definitely let me know if you still have problems.

Report

FrozenFox

11 years ago

Wonderful. It did indeed work either way without error. Without cd, it puts the resulting cursor tar file in /home/fox. Thanks a bunch :)

Report

ssuuddoo

11 years ago

uaaaa, finally a converter!

thnx body, I luv U 4 that. really.
will try it today.

wish luck in the year two ou ou eight.


=D

Report

11 years ago

Version 2.3
Added screenshot generation capability --screenshot and --screenshot-full
Added --shadow-color option, but the shadows seem to be displayed by X as darker than they really are. Suggestions appreciated.
Added ability to mirror all cursors before or after applying a shadow. --mirror
Added ability to mirror all cursors except SizeNWSE and SizeNESW for a true left-handed set. --mirror --left-handed
Fixed a problem with inputting the unzip utility.
Removed option for user to set temp directory. Too dangerous as files in it can be deleted. Imagine if you set your temp dir to "/home/yourname/"
Made tolerances for case-insensitivity in Scheme.ini and .png files for files included inside .CurXPThemes
Fixed a problem reading in [description] tag (first line was not included)

Version 2.2.1
Fixed a really obvious bug that I should have caught during testing. I sure hope there aren't more! ;) Sorry bout dat!
Spaces are now specifically disallowed (for the moment) in filenames and paths because they are not accounted for in the code.

Version 2.2
Now accepts a *.curxptheme file as input! No more PITA unzipping! Just add the theme location to the end of the command.
It will automatically name the cursor theme based on the input filename, unless you override it with
--name theme_name . (Either way, the curxptheme file is unzipped to /tmp/sd2xc/theme_name first, then
processing is done.) This adds another "temp" layer to things. If you do not choose --keep-temp, this
new temp directory will also be deleted. *ALWAYS* run as normal user, not root! Also,
The X11 theme .tar.gz file will be placed in the current directory if you use this method.
The old method of running inside a directory still works too.
Added resize option --resize which accepts an integer percent. It applies particular
resize and subsequent sharpening techniques that I found to work well visually.
Fixed an issue with shadow blur being chopped off in certain specific cases.
Huge speed increase by removing some redundant processing.
Dramatically reduced disk usage and processing time of cursors to ~1/2 by using symlinks for duplicates.
Fixed the verbose option -v and added --verbose. Also clarified its output.
Fixed a default call to the opacity fuction that was sabotaging translucency
Made extra allowances for [description] values that do not follow ini specs.
Now saves [description] values into index.theme "Comments" section.
Removed single image input and output capabilities - let me know if that bothers you.

Version 2.1
Installation (to ~/.icons) option: --install
Added option to not create tar.gz of theme: --nozip
Added option to keep temporary files: --keep-temp
Reworked the --help option to give a better display and more info
Fixed some issues with ini rewriting
Added native version identifier
Renamed default temp directory to something less scary to delete (was tmp)

Version 2.0
Started using version numbers, for my own sake. Sorry. ;)
Fixed shadow algorithm (how come nobody fixed it sooner??!)
Automatically creates a .tar.gz file of X11 cursors.
Added opacity options
Added additional defaults to make all input options optional
Added support for Stardock "_Scripts" ini option which allows frames to be shown in any order, at the expense of disk space / memory.

12345678910
1
product-maker henriquemaia Jul 26 2015 9 excellent
product-maker Count: 4 Rating: 5.0
File (click to download) Version Description Downloads Date Filesize DL OCS-Install MD5SUM
*Needs ocs-url or ocs-store to install things
Pling
Details
license
version
2.3
updated Jan 15 2008
added Dec 25 2007
downloads 24h
0
page views 24h 7
System Tags cursor linux unix