« Rogers cancels free Flickr Pro accountsUbertwitter, Twitterberry on steroids »

How to change an Xwindows cursor on Centos (and probably most other Linux distros)

05/14/09

  04:31:05 am by wdawe, Categories: General, linux , Tags: cursor, linux, x11

I wanted to modify one of my Xwindows cursors on my Centos 5 Linux system today and after a bit of research found the following article
"http://linuxgator.org/forums/viewtopic.php?f=15&t=303" which goes through the process in great detail, and is a great resource to creating your all the cursors you need for your own theme. I didn't need that much and only wanted a quick and dirty way to change one cursor. The instructions below are what I came up with.

The cursors you are using can be found in /usr/share/icons/Bluecurve/cursors/ This assumes you are using Bluecurve theme, if not replace Bluecurve with the name of your theme whose pointers you are using. To see which themes pointers you are using select System, Preferences, Mouse and click the pointers tab. The pointers you are using will be highlighted, you may need to scroll down to see which one is highlighted.

Commands you need to type are in bold, unhighlighted lines are explanation.
Open a terminal window
mkdir icons
cd icons
mkdir cursors
gimp

Create a .png of the cursor you want at the size you want, in this case we are changing the crosshair cursor so we'll call our new cursor file crosshair.png and save it in the icons subdirectory we just created, mine was a 32x32 pixel image.

Use gedit (or your favourite text editor) to create a file called config.in in the icons directory which contains information about your .png, mine contained a single line which looked like this.

32 16 16 crosshair.png 1000

32 is the size in pixels of the .png, the 16 16 is the click point of the cursor, in this case right in the middle. After the file is created and saved continue with the following commands.

xcursorgen config.in cursors/crosshair
The cursors directory should now contain a file called crosshair
su (enter your root password when prompted)
This assumes you are using Bluecurve theme, if not replace Bluecurve with the name of your theme whose pointers you are using.
mv /usr/share/icons/Bluecurve/cursors/crosshair /usr/share/icons/Bluecurve/cursors/crosshair.old (backs up the old cursor)
cp cursors/crosshair /usr/share/icons/Bluecurve/cursors
SAVE YOU WORK AND CLOSE ALL OPEN PROGRAMS !!!!!!!!
Restart Xwindows (Ctrl-Alt-Backspace) and your new cursor should be active. There is probably a way to do this without restarting Xwindows but I was in a hurry.

No feedback yet


Form is loading...

Cool web tools, EEPC tips and Linux info. Browse around, I'm sure you will find something to interest you.

Search

  XML Feeds

Free CMS