1

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

1L0VE

1 Answer 1

6

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:

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

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.

2
  • Better than expected! A universal solution.. thanks very much
    – elf12
    Jan 14, 2014 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. Jan 14, 2014 at 20:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .