78
|
Chapter 4, Related to X
#24 Convert CursorXP Themes for Use with Linux
HACK
This creates a subdirectory called Golden-XCursors-3D-0.8. (If the version of
Golden Cursors has changed since the publishing of this book, the filename will
be different. Follow these instructions using the new filename.) Change to this
subdirectory with the following command, and list that directory’s contents:
$ cd Golden-XCursors-3D-0.8
$ ls
COPYING Gold README default
In this case, the author created a README file, but let’s ignore it for a
moment and use the same reasoning used earlier to identify the relevant direc-
tory. Look in the directory called Gold by issuing the following command:
$ ls Gold
cursors
There’s the cursors subdirectory that we’re looking for. So, Gold is the direc-
tory we want. Copy the Gold directory to the ~/.icons directory:
$ cp -a Gold ~/.icons
Again, if you want the Gold cursor theme to be available to all users, copy
Gold to one of the shared directories instead. (Given the previous example of
how this Linux distribution is configured, the shared directories are /usr/local/
share/cursors/xorg-x11, /usr/share/cursors/xorg-x11, and /usr/share/pixmaps/
xorg-x11. They might be different for your system.) You need to log in as root
to do this; otherwise, you won’t have the privileges necessary to write to these
directories.
Edit the ~/.icons/default/index.theme file to contain these two lines:
[Icon Theme]
Inherits=Gold
Start up your favorite window manager or desktop environment (or restart
the one you’re using), and you should see the Gold mouse cursors.
HACK
#24
Convert CursorXP Themes for Use with Linux Hack #24
Convert custom cursor themes meant for Windows for use with Linux.
Want even fancier cursor themes than those currently available for Linux? A
company called Stardock has created a product called CursorXP for Win-
dows XP. It allows Windows users to choose from hundreds of fancy ani-
mated cursor themes. This hack is a script that will convert these cursor
themes for use with X11 under Linux.
A huge repository of publicly available cursor themes are designed for use
with CursorXP. You can find these themes at http://www.wincustomize.com.
The specific URL for the cursor themes is http://www2.wincustomize.com/
skins.asp?library=25.
Convert CursorXP Themes for Use with Linux #24
Chapter 4, Related to X
|
79
HACK
You can download one or more of these themes and then use a Perl script to
convert them for use with X11, the engine that powers your desktop. Eric
Windisch created the original Perl script, which Nicholas Petreley and James
Barron have since modified. This hack uses the version of the script called
np-sd2xc.pl, which you can download from the O’Reilly catalog page for this
book: http://www.oreilly.com/catalog/linuxdeskhks.
You need to have version 6 or better of ImageMagick installed for the script
to work properly. You also need these Perl modules installed:
Image::Magick
Getopt::Long
Config::IniFiles
Once you are sure you have all the prerequisite packages installed, download a
cursor theme to convert. For example, download the file Gear.zip. Unzip this
file to a work directory so that you can perform the conversion. These com-
mands (substitute the name of the zip file you’re using for Gear.zip if you are
using a different theme) use the newly created directory geartemp as a work
directory:
$ mkdir ~/geartemp
$ cd ~/geartemp
$ unzip Gear.zip
This expands your zip file into another file, which in this case is called Gear.
CurXPTheme. Even though this file has the extension .CurXPTheme, it’s
really just another zip file that you can expand with the following command:
$ unzip Gear.CurXPTheme
Now you’re almost ready to run np-sd2xc.pl. The -name command switch
defines the name of the cursor theme when you install it. This theme was orig-
inally called Gear, but you can use another name if you want. For the sake of
frivolity, give this theme a new name, CoolGear, by using this command:
$ np-sd2xc.pl -name CoolGear
The conversion program can add drop shadows to all the cursors when it
converts the CursorXP cursor themes. It’s a matter of taste, but I think drop
shadows give the cursor a very nice 3D appearance. If you want the cursors
to have drop shadows, add the
-shadow command switch and use this com-
mand instead:
$ np-sd2xc.pl –shadow -name CoolGear
Now you can install the theme (this example installs it in your home direc-
tory). The following commands both install the theme and set it as the
default theme (the
-R switch tells the cp copy command to recurse through

Get Linux Desktop Hacks now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.