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
5.8
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:

13 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.

deviantdark

13 years ago

Hi.
First of all, thanks for your share :)
I did everything in the mini-how to, and I have the folder within /home/username/.icons which were created by your script.
But when I try to configure my cursors from System > Appearance > Mouse, the theme isn't present.
How could this be?
Within .icons the folder is present, with an index.theme file and a folder named "cursors".

Can I get it out of there?
Thanks a lot.

Report

C

Moony

13 years ago

Hmmm... not sure why it's not there. Maybe someone else has experienced the same thing and can shed some light on this?

Report

Kraplax

13 years ago

I'm constatntly getting this problem:
Can't locate Image/Magick.pm in @INC (@INC contains: /usr/lib/perl5/5.8.8/i386-linux /usr/lib/perl5/5.8.8 /usr/lib/perl5/site_perl/5.8.8/i386-linux /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/i386-linux /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl .) at /usr/bin/sd2xc-2.1.pl line 63.
BEGIN failed--compilation aborted at /usr/bin/sd2xc-2.1.pl line 63.

So, i've found out, that my Image.pm located not in the /usr/lib/perl5/5.8.0/i386-linux, but in /usr/lib/perl5/5.8.0/i386-linux-mutli-thread.
So, i've made sym-links to the first and now i'm getting this:
Can't locate loadable object for module Image::Magick in @INC (@INC contains: /usr/lib/perl5/5.8.8/i386-linux /usr/lib/perl5/5.8.8 /usr/lib/perl5/site_perl/5.8.8/i386-linux /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/i386-linux /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl .) at /usr/bin/sd2xc-2.1.pl line 63
Compilation failed in require at /usr/bin/sd2xc-2.1.pl line 63.
BEGIN failed--compilation aborted at /usr/bin/sd2xc-2.1.pl line 63.
and the sd2xc process begins to consume the memory and cpu resources. I know, it has something to do with @NIC variable, but how can i set it up or change it to help sd2xc find the Image/Magick.pm without making any sym-links?
I'm running Mandriva 2008, thus installed ImageMagick from RPMs. And yeah, i'm not sure i've got the proper installation of ImageMagick-perl package, because i couldn't find any for my distro.

Report

C

Moony

13 years ago

You might try the package named: perl-Image-Magick

I don't know for sure... I just found that by googling.

Report

CryoGenFX

13 years ago

I only get a


Scheme.ini in wrong format? - at ../src/sd2xc-2.1.pl line 325.

on every cursorxp theme.

help?

Report

CryoGenFX

13 years ago

hm, I downgraded to 2.0 and that worked, seems a 2.1 problem.

Report

C

Moony

13 years ago

Yes, that was my oops. Redownload and try again. Sorry!

Report

unabatedshagie

13 years ago

Here is a list of the ubuntu package names.

libconfig-inifiles-perl
perlmagick
imagemagick
xcursorgen

Nice work btw.

Report

C

Moony

13 years ago

Thanks for the info. I've updated the instructions above.

Report

devport

13 years ago

Great stuff.

Does it support animation ?

Report

C

Moony

13 years ago

Yes, it does. It also supports variable frames of that animation. E.g. first show frames 1-10, then show frames 11-20 over and over.

Report

13 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
Be the first to comment
File (click to download) Version Description Downloads Date Filesize DL OCS-Install MD5SUM
*Needs pling-store or ocs-url to install things
Pling
0 Affiliates
Details
license
version
2.3
updated Jan 15 2008
added Dec 25 2007
downloads 24h
0
mediaviews 24h 0
pageviews 24h 3