54

I'm building a kiosk using Ubuntu Precise on a touch screen. Now I'm looking for the appropriate way to make the mouse cursor disappear. As people know where they are pointing, displaying an arrow under their finger is useless, and having an arrow where they last pointed even more so.

My best bet would be some kind of cursor theme consisting only of transparent cursors. I'm a bit surprised to find no UI to switch and maybe install cursor themes in the default Unity UI, but as I won't be using Unity, that's not much of a problem. It appears that the alternatives listed in update-alternatives --list x-cursor-theme all refer to .theme files, so I searched the package list for those. The resulting list does not list any likely candidates, i.e. no packages containing “invisible” or “transparent” in their name.

So far, some googled result yielding a readme for “XCursor Transparent Theme” is my best bet. That would mean compiling those sources myself, perhaps putting them into my PPA. I'm also a bit sceptical about that result as said readme is dated from 2003. And I'm not sure that I'm not making things overly complicated. After all, there is quite some support in Precise for touch devices, so I don't believe I'm the first one who wants to get rid of his mouse cursor.

  • Is there another way which doesn't involve user-compiled binary code?
  • Is there a theme package for transparent cursors which I've overlooked?
  • Is there some other mechanism to make the cursor disappear without changing the cursor theme?

I'll be using Matchbox WM, Firefox and Java applets, so I'll be happy with any solution working under such a setup. I'm not interested in any solutions twiddling with Gnome or Compiz, as I'll not be running either.

MvG
  • 1,536

9 Answers9

58

Try unclutter.

The purpose of this program is to hide the pointer after the mouse has not moved for a while. Using it, you can make the pointer appear only when the user touches the screen, and disappear right after it. Maybe this was not exactly what you were aiming for, but it is much easier than your alternative.

To use it, first install it:

sudo apt-get install unclutter

then run it:

unclutter -idle 0.01 -root

The number in the above command is the number of seconds before the pointer disappears (in this case, 1/100 seconds).

josinalvo
  • 7,017
29

If you never want the cursor to appear (appropriate for touchscreens) unclutter won't suffice from my experience. Instead you can use use -nocursor when starting X.

Example:

startx -nocursor

See http://www.x.org/wiki/AdvancedTopicsFAQ/#index1h2

Gibbs
  • 941
15

If you are using lightdm:

Edit /etc/lightdm/lightdm.conf by adding:

xserver-command=X -bs -core -nocursor

if you are using nodm:

Edit /etc/default/nodm by replacing:

NODM_X_OPTIONS='-nolisten tcp'

with

NODM_X_OPTIONS='-nolisten tcp -nocursor'

This is building from Gibbs very helpful answer

Peter
  • 391
3

Ubuntu 16.04

Open /usr/share/lightdm/lightdm.conf.d/50-xserver-command.conf and edit this line:

xserver-command=X -core

Append -nocursor to it. Like this:

xserver-command=X -core -nocursor

Save and restart.

Warning: Like other answers on this question, mistakes on this file will prevent Xorg initialization. Anyway, you can still can login to terminal and revert.

1

Another Option is to set the cursor theme in ubuntu to an invisible theme. For that I created one. You can find it here https://github.com/gysi/ubuntu-invis-cursor-theme

1

Unclutter new x11 version has some options of note start hidden and hide on touch https://github.com/Airblader/unclutter-xfixes/blob/master/src/unclutter.c

Change unclutter.c

Config config = {
    .timeout = 0, //default 5
    .jitter = 0,
    .exclude_root = false,
    .ignore_scrolling = false,
    .ignore_buttons.count = 0,
    .ignore_buttons.buttons = NULL,
    .hide_on_touch = true, //default false
    .fork = false,
    .debug = false,
    .onescreen = false,
    .ignore_matches = false,
    .matches = NULL,
    .start_hidden = true //default false
};
1

Another option I have found is to use xbanish.

  1. Clone the repository into your directory of choice
git clone https://github.com/jcs/xbanish
  1. (optional) I had to make sure that libxt-dev was installed with
sudo apt install libxt-dev
  1. After making sure that you are in the xbanish directory, make the file by just running
make
  1. Now you may run with
./xbanish

You should note that this solution will only work if you have the program running, so you may want to set it to run at start up as well.

Kalcifer
  • 233
1

I don't have enough reputation to comment on the accepted answer, so I will just add this here.

If you are on Wayland, unclutter does not work. I need to hide the cursor for a kiosk system, and I don't care about Wayland, so I decided to just disable it:

sudo nano /etc/gdm3/custom.conf

Change the following line:

WaylandEnable=true

To:

WaylandEnable=false

Note: the WaylandEnable=true line may not be present, in that case, just add WaylandEnable=false underneath the [daemon] section

There is also a way to disable the cursor on Wayland, but I think that is a little more involved than it's worth for my use case.

0

apt install unclutter-xfixes

#Run Startup Bash Script

unclutter --timeout 0 --hide-on-touch --start-hidden&

YALCIN
  • 1