Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

share|improve this question
add comment

1 Answer 1

up vote 4 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:

#!/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.

share|improve this answer
    
Better than expected! A universal solution.. thanks very much –  elf12 Jan 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 at 20:52
add comment

Your Answer

 
discard

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.