SLAX Unclutter

InfoDabble > Tech Notes > SLAX Unclutter
Jump to: navigation, search
This project is still under development.

Do you ever find that occasionally the mouse pointer obscures just the bit of the screen with the word you’re currently reading? Having to move the mouse or guess the word under the pointer is only a minor irritation but it can be an irritation none-the-less.

Unclutter is a small but unique package for X11. What it does is very simple: if you aren’t using the mouse, it hides the mouse. This is useful simply because if you aren’t using the pointer, there’s no reason for it to be visible. This may not sound particularly useful, but making the mouse be invisible frees up screen real estate, prevents it from distracting you, and just generally makes for a much more pleasant experience, particularly when reading a document or using primarily keyboard-based applications.

Unclutter is easy to use. Just put a line like this in your .xsession, .gnomerc, “Startup Programs” or wherever you enter commands to be run at startup/login:
unclutter &

Now, if you stop moving your mouse, the cursor will disappear after 5 seconds.

[edit] SLAX Binary and module

The Debian Linux 386 binary works on SLAX.

I collected the binary, source, and document files and used dir2mo to build a SLAX module unclutter-8.5.mo (from unclutter-8.5.tar)

  • usr/
    • bin/
      • unclutter
    • doc/
      • unclutter/
        • changelog.Debian.gz
        • changelog.gz
        • copyright
        • README
    • man/
      • man1/
        • unclutter.1.gz
    • src/
      • unclutter.tar

The entire SLAX package unclutter-8.5.mo is only 20K in size. See: SLAX doc modules page.

[edit] Review: The Unclutter Utility

by Larry Ayers < layers@vax2.rain.gen.mo.us> Copyright (c) 1996. Published in Issue #7 of the Linux Gazette - March 1996

Have you ever noticed when editing text that as soon as you release the mouse and start typing, the cursor ends up obscuring a letter you'd like to see? I'd always classified this as one of those minor unavoidable annoyances of life, like TV commercials or hangnails, which shouldn't be dwelled upon.

So why I am I writing this? Because a programmer named Mark M. Martin evidently had had enough of mouse cursors outstaying their welcome. He wrote a tiny memory resident program, most conveniently started from the xinitrc file, which initially does nothing but wait. It patiently waits for your mouse cursor to stay still for a configurable number of seconds; when this occurs the program simply makes the cursor transparent until you move it again.

The down side of this is that once you become accustomed to this behavior, any time you might be working at a computer which doesn't have unclutter installed, or happen to be using DOS or OS/2, you really notice that cursor. Unclutter becomes sort of a positive reinforcement for using Linux!

Availability: Unclutter is probably on every Linux ftp site, but you have to watch out for an older version which may not work on current systems. This is version 1, dated 1992. Version 2, released in 1994, compiles cleanly, and I've never had any trouble with it. It's a small download; just grab anything called unclutter.tgz and unpack it to see if it's the right one.

[edit] man page: UNCLUTTER (1X)


NAME
unclutter - remove idle cursor image from screen
SYNOPSIS
unclutter [-display|-d display] [-idle seconds] [-keystroke] [-jitter pixels] [-grab] [-noevents] [-reset] [-root] [-onescreen] [-not] name ...
DESCRIPTION
unclutter removes the cursor image from the screen so that it does not obstruct the area you are looking at after it has not moved for a given time. It does not do this if the cursor is in the root window or a button is down. It tries to ignore jitter (small movements due to noise) if you have a mouse that twitches.
OPTIONS
-display
is followed by the display to open.
-idle
is followed by the number of seconds between polls for idleness. The default is 5.
-keystroke
tells unclutter not to use a timeout to determine when to remove the cursor, but to instead wait until a key has been pressed (released, really).
-jitter
is followed by the amount of movement of the pointer that is to be ignored and considered as random noise. The default is 0.
-grab
means use the original method of grabbing the pointer in order to remove the cursor. This often doesn't interoperate too well with some window managers.
-noevents
stops unclutter sending a pseudo EnterNotify event to the X client whose cursor has been stolen. Sending the event helps programs like emacs think that they have not lost the pointer focus. This option is provided for backwards compatibility in case some clients get upset.
-reset
resets the timeout for idleness after the cursor is restored for some reason (such as a window being pushed or popped) even though the x y coordinates of the cursor have not changed. Normally, the cursor would immediately be removed again.
-root
means remove the cursor even if it is on the root background, where in principle it should not be obscuring anything useful.
-onescreen
restricts unclutter to the single screen specified as display, or the default screen for the display. Normally, unclutter will unclutter all the screens on a display.
-not
is followed by a list of window names where the cursor should not be removed. The first few characters of the WM_NAME property on the window need to match one the listed names. This argument must be the last on the command line.
LIMITATIONS
The -keystroke option may not work (that is, the cursor will not disappear) with clients that request KeyRelease events. Games and Xt applications using KeyUp in their translation tables are most likely to suffer from this problem. The most feasible solution is to extend unclutter to use the XTest extension to get all keyboard and mouse events, though this of course requires XTest to be in the server too.

The -keystroke option does not distinguish modifier keys from keys which actually generate characters. If desired this could be implemented in a simple way by using XLookupString to see if any characters are returned.
DIAGNOSTICS
The message
someone created a sub-window to my sub-window!
means that unclutter thinks a second unclutter is running, and tried to steal the cursor by creating a sub-window to the sub-window already used to steal the cursor. This situation quickly deteriorates into a fight no one can win, so it is detected when possible and the program gives up.
AUTHOR
Mark M Martin. cetia 7feb1994. mmm@cetia.f

[edit] References

[edit] Files