Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 01-30-2009, 02:37 AM   #1
LQ Newbie
Registered: Jan 2009
Distribution: Ubuntu / LFS/BLFS/CLFS
Posts: 20

Rep: Reputation: 1
Manually setting X Cursor or Theme - doesn't work, no errors

I am developing a LFS/CLFS/BLFS system that I have gotten working all the way through X-windows and loading a browser which is the intended use. It has a touch screen, and will be used as a kiosk.

I started with CLFS 1.1.0, and then extended it with BLFS 6.3/svn.
X version 7.2.0
Kernel version
I would like to turn off, or hide, or make transparent the cursor in X. I have tried several items with no luck.

1. I created a file ~/'emptycursor', with the following contents:
#define nn1_width 16
#define nn1_height 16
static unsigned char nn1_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
and added:
xsetroot -cursor emptycursor emptycursor
to my ~/.xinitrc.

This works, but only while the cursor is over the background/desktop. When I move the cursor over a window, a context sensitive cursor comes back, the arrow pointer, the text symbol, etc.

2. I tried a transparent cursor theme from:
This configures, compiles, and installs just fine. It installs to
However, I can't get this theme to work. The directions have you create ~/.icons/default/index.theme with the following contents:
[Icon Theme]
The directions also mention you may have to create a link:
ln -s ~/.icons/xcursor-transparent /usr/local/share/icons/xcursor-transparent
which I did, and it still doesn't change any behavior.

3. When I installed X, I also installed xcursor-themes-1.0.1, which includes redglass and whiteglass themes. These installed to:
/usr/X11/share/icons/handhelds (I think this was part of xcursor-themes)
The directions state to use ~/.Xresources with the following contents:
Xcursor.theme: whiteglass
*background: blue   (not related, but for testing)
This doesn't change the behavior. I have tried "xrdb -load .Xresources" and "xrdb -merge .Xresources", with no change from either, both work with no errors.

4. I tried moving the xcursor-transparent files/directories to /usr/X11/share/icons/xcursor-transparent/*, and nothing changed. I also tried moving /usr/X11/share/icons/* to a different directory all together, still no change, and still no errors.

5. The most perplexing part is I don't get error messages anywhere that I know to look. /var/log/Xorg.0.log doesn't say anything about cursors, icons, themes, etc.

6. Here is my ~/.xinitrc
# Begin .xinitrc file
xsetroot -cursor emptycursor emptycursor
xterm  -g 80x40+0+0   &
xclock -g 100x100-0+0 &
xrdb -load ~/.Xresources &

7. I don't want to clutter up this post with my .twmrc, but I will post it if necessary. It doesn't have any themes, cursors, it's very simple. It sets up two menus, set random placement, and that's about it.

So, I am hoping that somebody can point out what I am doing incorrectly, and help me get a hidden or transparent cursor.

Thank you, Paul.
Old 02-05-2009, 12:08 AM   #2
LQ Newbie
Registered: Jan 2009
Distribution: Ubuntu / LFS/BLFS/CLFS
Posts: 20

Original Poster
Rep: Reputation: 1
Here is how I solved my cursor problems.

Get the xcursor-transparent-theme-0.1.1.gz package. Un-pack it and change into it's source directory. Run the following commands (replace user with appropriate directory):
cd cursors
make install-data-local DESTDIR=/home/user/.icons/default CURSOR_DIR=/cursors
chown -R user:user /home/user/.icons
(I don't know if the chown command is necessary)

This makes a file /home/user/.icons/default/cursors/transp which is the transparent cursor. It also creates a bunch of links to this file with the names of the X-windows cursors, arrow, base_arrow_down, base_arrow_up, based_arrow_down, based_arrow_up and about 75 more.

As best as I can tell X-windows' default location for cursors is ~/.icons/default/cursors, and without any other direction, it looks there first. This works to replace the cursors with a transparent cursor, and I haven't seen any cursors since.

When X first starts, the default "X" cursor shows up on the hatched background until other applications load.

I also created the emptycursor file above, and added the following to my ~/.xinitrc which hides the default "X" cursor almost right away.
xsetroot -cursor /home/user/.icons/default/cursors/emptycursor /home/user/.icons/default/cursors/emptycursor
The full path is important in xsetroot, because a partial path is attempted from where you issued the "startx" command.

Hope it helps somebody in the future.

Last edited by paulcsf; 02-05-2009 at 12:12 AM.
1 members found this post helpful.
Old 01-13-2011, 10:33 AM   #3
Registered: Feb 2004
Posts: 44

Rep: Reputation: 15
I know the thread is old, but thank you for posting you solution to your original problem.

I tried an approach using the Xlib functions like :
XDefineCursor(display, rootWindow, cursor);

But applications like firefox seem to be redefining and this does not work.

Do you have a dynamic solution ( on / off ) without restarting the X ?


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't change the cursor theme alexandroos Slackware 1 05-20-2008 07:54 PM
Cursor theme in IceWM BuilderQ Linux - Desktop 0 10-17-2007 10:37 PM
FC 5 install GNOME cursor theme theolddrummer Linux - Software 2 03-31-2006 07:17 PM
Make a cursor theme J_K9 Linux - General 0 02-13-2006 04:41 AM
kde / gtk cursor-theme / theme issue - gentoo imperfect Linux - Newbie 1 01-08-2006 05:09 PM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:19 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration