You are not logged in.

#1 2009-10-12 16:20:40

milomouse
Member
Registered: 2009-03-24
Posts: 940
Website

How to 'warp' the cursor through cli

As the topic states, I was wondering if there was a way to warp the position of the cursor on the X screen to the corner (kind of like the ratpoison window-manager's "banish"). The only way I do it now is just by moving the cursor manually with my touchpad to the bottom right corner and then disabling it (via touchpad 'disable' button). I was just curious if there was a way to do this with the command-line, such as sending a signal to a certain program or library or something. I searched the forums and couldn't find anything as "cursor warp mouse, etc" were vague. But a Google search revealed something about doing

You can instead use a custom cursor which is invisible.

In Unix, save the following as none.cur:

 #define none_width 1
 #define none_height 1
 #define none_x_hot 0
 #define none_y_hot 0
 static unsigned char none_bits[] = {
    0x00};

Then use:

 proc show_cursor {} { .c conf -cursor "" }
 proc hide_cursor {} { .c conf -cursor "@path_to_cursor/none.cur black" }

This is supposed to make the cursor invisible and then reveal it again (could be keybound, I guess) but I can't seem to get it to work. Any tips on warping it to the corner or making it completely disappear/reappear are appreciated, thanks.

Offline

#2 2009-10-12 16:35:47

portix
Member
Registered: 2009-01-13
Posts: 757

Re: How to 'warp' the cursor through cli

You can use swarp from community.

Last edited by portix (2009-10-12 16:36:50)

Offline

#3 2009-10-12 17:13:00

Peasantoid
Member
Registered: 2009-04-26
Posts: 928
Website

Re: How to 'warp' the cursor through cli

To move the cursor, you'd do:

xdotool mousemove $x $y

where $x is the width of your screen and $y is the height.

Disabling touchpad:

synclient -s TouchpadOff=1

(if you have a Synaptics touchpad)

I suggest reading up on xdotool. Very useful.

Last edited by Peasantoid (2009-10-12 17:14:22)

Offline

#4 2009-10-12 17:19:30

Procyon
Member
Registered: 2008-05-07
Posts: 1,819

Re: How to 'warp' the cursor through cli

And xwarppointer in AUR if you need multi-monitor warping too.

[community] unclutter for hiding the mouse.

Offline

#5 2009-10-12 17:34:34

milomouse
Member
Registered: 2009-03-24
Posts: 940
Website

Re: How to 'warp' the cursor through cli

Peasantoid wrote:

To move the cursor, you'd do:

xdotool mousemove $x $y

where $x is the width of your screen and $y is the height.

Oh, neat. I didn't even have that installed. Did so, and it works like a charm! Thanks, much.

Peasantoid wrote:

Disabling touchpad:

synclient -s TouchpadOff=1

(if you have a Synaptics touchpad)

Well, I tried this from the command-line and it says:

%: synclient -s TouchpadOff=1
Can't access shared memory area. SHMConfig disabled?
%: sudo synclient -s TouchpadOff=1
Can't access shared memory area. SHMConfig disabled?

So I went to http://embraceubuntu.com/2006/03/24/dis … -touchpad/ and did as stated, adding the xorg.conf entry, etc, then restarted X and it still says the thing about SHMConfig disabled.  Not a big deal, I can always just press the little button on my laptop anyway; just like mapping the command to another key. Still, I'm wondering why it wont work.

@Procyon: Thanks! I was wondering about that. I'm on a laptop so I won't need the multi-monitor thing, not just yet anyway. tongue

Offline

Board footer

Powered by FluxBB