Can I remove the mouse pointer entirely from X?

7,890

Configure your X session to start with the argument -nocursor. For example:

exec /usr/bin/X -nocursor -nolisten tcp "$@"
Share:
7,890

Related videos on Youtube

BlackCap
Author by

BlackCap

Updated on September 18, 2022

Comments

  • BlackCap
    BlackCap over 1 year

    Can I remove the mouse pointer entirely from X? As in removing it and not just hiding it?

    I don't use the mouse at all. Everything I do is completely keyboard driven, so I hide the mouse pointer and disable my touchpad. However, the cursor still has a position on my screen, which causes applications to fire hover events.

    This can be extremely annoying, for instance in chrome, if a link happens to intersect the cursor it will display a bright white tooltip in the bottom left of the window.

    • Gilles 'SO- stop being evil'
      Gilles 'SO- stop being evil' about 7 years
      Wouldn't it be enough to move the pointer to a non-annoying location (e.g. one of the screen corners)?
    • BlackCap
      BlackCap about 7 years
      @Gilles I am using a tiling window manager, so I am always using the entire screen such that every point on my screen is inside some window. If however I could move the cursor to a point outside my screen, that would work
    • Satō Katsura
      Satō Katsura about 7 years
      Just disable the pointer driver from xorg.conf then?
    • dirkt
      dirkt about 7 years
      The core pointer is so deeply ingrained into X that I don't think it can be completely disabled. Would disconnecting all devices that move it around, and then moving it outside the visible screen space (e.g. with xte or xdotool) be acceptable?
    • dirkt
      dirkt about 7 years
      xte accepts negative numbers, but my fvwm seems to intercept and correct the mouse position because of virtual desktops. Worth a try with your WM.
  • BlackCap
    BlackCap about 7 years
    -nocursor seems to only hide the cursor. It can still be moved around, clicked, and more importantly- trigger hover events
  • airhuff
    airhuff about 7 years
    Hmm, not good. What window manager / desktop environment do you use? Does your distribution have the unclutter program?
  • BlackCap
    BlackCap about 7 years
    I am using XMonad, and tested -nocursor both with and without it. unclutter too only serves to make the cursor invisible, and is in fact how I have been doing so up until now.
  • airhuff
    airhuff about 7 years
    unclutter may not be what you want though. From the Arch Linux wiki: "Unclutter hides your X mouse cursor when you do not need it, to prevent it from getting in the way. You have only to move the mouse to restore the mouse cursor. Unclutter is very useful in tiling window managers where you do not need the mouse often. "
  • airhuff
    airhuff about 7 years
    If I remove or disable my external USB mouse, then rmmod psmouse not only disables my touchpad, but makes the mouse cursor disappear. Have you tried anything along these lines (i.e. rmmod psmouse)?
  • BlackCap
    BlackCap about 7 years
    rmmod psmouse did absolutely nothing for me. It did unload the module but the touchpad is still usable. If I disable the touchpad with xinput the cursor is still visible.
  • airhuff
    airhuff about 7 years
    Doeslsmod |grep mou show anything else looking like a mouse-related module, like mousedev? If so, and rmmod mousedev doesn't work, then I'll keep looking, but off-hand I'm stumped.
  • BlackCap
    BlackCap about 7 years
    lsmod | grep mou listed mousedev and nothing else. rmmod mousedev did not help. I also found that synaptics was installed on the machine, so I removed it and rebooted, which also did not help.
  • 17xande
    17xande over 6 years
    can anyone point me to where the -nocursor flag is documented? I can't find anything in the man pages I've seen so far. I'm running on raspian stretch.
  • 17xande
    17xande over 6 years
    Never mind, finally found it here.
  • BlackCap
    BlackCap almost 6 years
    After uninstalling the entirety of gnome, suddenly -nocursor works, which is odd because I remember testing this with startx. I suppose something overloaded it.