HOW TO USE ENLARGED MOUSE CURSORS WITH THE X WINDOW SYSTEM Joerg Schneider http://i11www.ira.uka.de/~schneid CONTENTS Introduction How to do it Notes and limitations Technical discussion Other ideas howto make the mouse cursor more visible Related info How to use a fontserver Howto get the bdf source for some font INTRODUCTION There are several reasons why the standard X mouse cursors are hard to track for some people: * when running X on a notebook with low contrast LCD * on normal screens when using high resolution, 1600x1280 e.g. * for visually impaired persons even on normal hardware In all cases it might help to use enlarged mouse cursors. Ideally this job should be done by a single X program that automatically enlarges every mouse cursor. To my knowledge there is no simple way to write a utility like this, because the X protocol has no provision to query mouse cursors. For more details see the technical discussion below. If we aim for a less general goal, though, something can be done: There is a set of standard mouse cursors that can be found in the cursor font (try `xfd -fn cursor' to look at it). Most programs use these mouse cursors and the key idea is to replace the standard cursor font an enlarged version. HOW TO DO IT Note: there is also a WWW version of this MINI-HOWTO with hyper links and some additional goodies :-): http://i11www.ira.uka.de/~schneid/ 1. get cursor.bdf, the source of the cursor font, from some X distribution, e.g. from ftp://ftp.x.org/pub/R6.1/xc/fonts/bdf/misc/cursor.bdf 2. get and install the bdfresize package: ftp://ftp.cs.titech.ac.jp/X11/contrib/bdfresize-1.4.tar.Z 3. create a directory and install a magnified cursor font in it (magnification factor 2 in this example): mkdir $HOME/fonts bdfresize -f 2 cursor.bdf | bdftopcf >$HOME/fonts/cursor2.pcf mkfontdir $HOME/fonts 4. modify your .xinitrc or .xsession file: before any X client (that uses cursors) is started the following commands must be executed: xset +fp $HOME/fonts xsetroot -cursor_name X_cursor 5. leave your X session and restart That's it -- now all mouse cursors should have doubled in size. NOTES AND LIMITATIONS: * X servers may have a limit for the maximum mouse cursor size -- I have no information about that. * The magnified cursor font must have the same name as the original font (font name `cursor', file name does not matter) -- this is no problem as bdfresize does not change the font name. * the directory with the new cursor font must be placed before the directory with the standard cursor font in the the font path -- this is accomplished with `xset +fp' (as opposed to `xset fp+') * changes in $HOME/fonts/cursor.pcf will be visible only after the command `xset fp rehash' and only in newly started X clients (more exactly: for newly created cursors). * `xset +fp path' may not work on a X-Terminal. In this case a font server can be used (if supported by the X-Terminal) or some other method to install the font on the X-Terminal (This can generally only be done by your system administator). * the same approach can be used for olcursor and decw$cursor fonts and any other cursor font you may encounter. TECHNICAL DISCUSSION Is it possible to write a X program that enlarges cursors automatically? (Partial) solution 1: Use the XTestCompareCursor from the XTEST extension. For all windows the mouse pointer enters compare the cursor of this window with a set of `known' cursors (e.g. from the cursor font). If the cursor is found, replace it with an enlarged version, otherwise either leave it alone or substitute a standard cursor. This will only work where the XTest extension is available (where?). Solution 2: Write a proxy X server that relays all client requests unchanged to the real X server, except that it intercepts all requests corresponing to the XCreate*Cursor Xlib functions. XCreate*Cursor request should be modified to use an enlarged cursor. OTHER IDEAS HOWTO MAKE THE MOUSE CURSOR MORE VISIBLE Here are some ideas for rather simple X programs that might make mouse cursors easier to track. * use XRecolorCursor to change the mouse cursor color every 0.1 s * When a hotkey is pressed display something (big cursor, small window, shaped window) at pointer position for 0.5s. RELATED INFO HOW TO USE A FONTSERVER A font server is a net service that provides a set of X11 fonts with a simple protocol. It can be queried which fonts it provides and will supply the font bitmap data on request. You might want to use a font server to provide the X server with a modified cursor font, instead of telling it where to find the font on the file system. This method is especially handy if you use several machines that don't share a common file system or if you use a X terminal that supports the font server protocol. A font server program and associated tools comes with the X11R5+ distribution (AFAIK). Setting up a font server Read the manual pages fs(1), fslsfonts(1) and try it -- it isn't hard. Say, you are running the server on host some.host.edu on port 7100. You can test the setup with the command fslsfonts -server some.host.edu:7100 To actually use the server issue the command xset +fp tcp/some.host.edu:7100 which should return without an error message. HOWTO GET THE BDF SOURCE FOR SOME FONT If you have set up a font server simply use fstobdf which comes with the font server. Alternatively you may try getbdf which can dump any installed X11 font to a bdf file. VERSION This is the initial version: 0. Thu Sep 12 1996 FEEDBACK Any comments are welcome (more ideas, simpler solutions, programs that do similar things, spelling, grammar, style...)!