Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I really miss the feature from Gnome2 and Mate that you can click on a panel app and the mouse cursor is hidden. The mousetweaks package promises "... * An area to capture the mouse pointer until it is released with a pre-defined key combination." but the app is not shown anymore by default (xubuntu 13.10 - xfce 4.10). Is there a cool hack to get this back?

Edit: Imagine that sign in top RIGHT that looks like mouse is "The Trap" that when clicked catches the cursor (and releases when specific shortcut done): enter image description here


share|improve this question
up vote 5 down vote accepted

Maybe another solution does the trick:

You might create a panel launcher that runs a shell script to disable mouse input and a keyboard shortcut to enable mouse input.

You can manage your X-Server's input devices with xinput. With the following command, you can list all input devices:

xinput --list

Find the right mouse pointer device and disable it: (replace [ID] with the right id number)

xinput --set-prop [ID] 'Device Enabled' 0

Enable it again:

xinput --set-prop [ID] 'Device Enabled' 1

To simulate the behavior of the tool you wish, you can create a shell script to disable/enable all mouse pointer devices at once.


# setmouse 0    to disable mouse
# setmouse 1    to enable mouse
for id in $(xinput --list | grep -E "slave.*pointer" | cut -f2 | cut -d"=" -f2)
    xinput set-prop $id 'Device Enabled' $1

Then you can create a (Xfce-)Panel launcher that runs "setmouse 0" in order to disable mouse input and a keyboard shortcut that runs "setmouse 1" to enable it again.

share|improve this answer
Better than expected! A universal solution.. thanks very much – elf12 Jan 14 '14 at 19:51
This "Mousetrap" panel launcher will make the cursor to stay above the button. If you want it to disappear, you can use xdotool to move the mouse pointer to a place, where it doesn't annoy you. – Peter Holzer Jan 14 '14 at 20:52

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.