unclutter: hide the mouse cursor after a period of inactivity

March 27th, 2007 edited by lucas

Entry based on submissions from Oliver Kiddle, Tore Morkemo and Gwern Branwen. Yes! Three independent readers wrote about it, it must be good :-)
Remember, DPOTD needs your help, please contribute !

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.

Unclutter has a few nice arguments worth checking out:

  • -idle 2 : hide the mouse after 2 seconds, instead of the default (5).
  • -keystroke : tells unclutter to hide the mouse cursor when you start typing on the keyboard.
  • -not : don’t hide the cursor in windows listed as arguments.

There are more options, just check out the man page.

Unclutter is a maintained, stable & largely bug-free package which has been included in basically all versions of Debian and Ubuntu.

Posted in Debian, Ubuntu |

22 Responses

  1. Geoffroy Carrier Says:

    If you have problems with a “randomly” moving cursor in some SDL applications (like xmoto, Quake3-based games, etc.), try to kill it.

  2. peder Says:

    Thank you, thats a great trick! :D

  3. Geoffroy Carrier Says:

    Did that happen to you?
    It took me a few days to find out why my cursor went crazy, as I was also hacking my window manager (dwm) at the time I started using unclutter…

  4. Richard Says:

    I use unclutter too, and that nasty “randomly moving” cursor bug Geoffroy referred to bite me a few times and because i play very rarely (once a year maybe) I always have to rediscover it from scratch… *sigh*

  5. Will Godfrey Says:

    This is an excellent little utility. I would never have found it !

  6. Eric Davis Says:

    Nice and simple utility.

  7. Ben Nevis Says:

    It’s not working for me.
    I’m starting unclutter from ~/.kde/Autostart. The process is running but my cursor won’t disappear.
    Did I miss something?

  8. patpi Says:

    you should SUBMIT LINKS to homepage of any revieved application. Searching for “unclutter: hide the mouse cursor after a period of inactivity” in Google won’t show me the homepage with sources

  9. Jared Says:

    Use apt-get, patpi.

  10. patpi Says:

    Jared, it’s Debian Package of the Day but i use KateOS :P

    This suit is good resource even for non-debian users :)

  11. Tincho Says:

    patpi: that’s great, but don’t expect the site to be tailored for non-{debian,ubuntu} users :)

    In fact, many times the homepage of the application is linked, but we’ll take the suggestion.

    For unclutter, I couldn’t find the homepage, maybe it hasn’t got one.

  12. Bernardo Kuri Says:

    Wanted to add that this is the perfect addition to Beryl’s “Input Enabled zoom” plugin.
    Thanks for sharing this!

  13. Andy Says:

    This is great. Why did we always leave the mouse pointer sitting there like a gooseberry when we didn’t want it!!!!

  14. luke Says:

    Could anyone help with this problem? I’ve installed unclutter but it doesn’t seem to work. Ie my cursor doesn’t go away. I would also like to add arguments (ie to make the cursor disappear after 1 second) but I’m new to linux and can’t work out how to do it. Many thanks in advance for any advice.

  15. jack Says:

    luke: you’ve installed the software, now you have to start it.

    Give the command:
    unclutter -idle 1 &

    (in a terminal).

  16. aralbald Says:

    Niftyy! OK, so if someone is interested in hiding the mouse cursor as long as this app is running (even when a mouse is clicked or a key is pressed) - you can change the line in unclutter.c from:
    #define ANYBUTTON (Button1Mask|Button2Mask|Button3Mask|Button4Mask|Button5Mask)
    #define ANYBUTTON (’ ‘)

    Recompile (just a simple “make” in the source directory will do) and run the program with the command:
    ./unclutter -idle 0 -root

    This can be useful when running windows applications with wine.

  17. Free Mouse Pointers Says:

    ingenious! do they have this in Windows?

  18. bill Says:

    In my ~/.bashrc from ancient suse release:

    # Kludge to handle the su problem and VNC if I’m in an xterm
    if [ $TERM = "kterm" ]; then
    xhost +jumbo >> /dev/null
    xhost +shrimp >> /dev/null
    xhost +opihi >> /dev/null
    xhost +clam >> /dev/null

    # A couple of other things turnoff screen blanking and the cursor…

    xset s off
    xset s noblank
    if [ "`ps aux | grep unclutter | grep -v grep`" = "" ] ;
    unclutter &

  19. bhupesh karankar Says:

    unclutter -display :0.0 -idle 1

  20. key stroker Says:

    the -keystroke option does not work as described in this article … i’m not sure what it really does but i won’t be using this app after all

  21. Mike Says:

    If you wanted unclutter to only hide the pointer on certain windows, a special regex can be used to reverse the -not* options -

    unclutter -regex -notclass ‘[^(MPlayer)]+’

  22. Amit Says:

    Doesn’t work in terminal applications. Using urxvt here.