You are not logged in.

#1 2013-02-06 09:49:23

Kubouch
Member
From: Czech Republic
Registered: 2013-01-03
Posts: 25

[SOLVED] awesome automatic mouse movement

Hi,
I use awesome as my window manager on my Thinkpad. I often use middle-button to copy-paste texts and I'd like to automatically move my mouse cursor on the currently focused window.

Example of conflict situation:
I have two terminals opened. The first one is focused and it's the one I'd like to copy some stuff into. However, my mouse cursor is hovering upon the other (unfocused) terminal. When I press middle-button, the stuff is copied into the unfocused terminal. In order to copy the stuff into the correct terminal, I need to manually navigate cursor onto the correct window which is annoying.
I know that
I tried E17 once and it had such feature. Is there any way to make awesome behave like this? Note that I know almost nothing about programming (I can understand some basic functions, though) so if there's any scripting involved, please use the simplest terms :-).

Cheers,
Kubouch

Last edited by Kubouch (2013-02-07 22:26:31)

Offline

#2 2013-02-06 12:03:54

Thorsten Reinbold
Member
From: Germany
Registered: 2011-12-06
Posts: 353

Re: [SOLVED] awesome automatic mouse movement

Have a look at xdotool. Sounds like it could fit your needs perfectly. wink

Offline

#3 2013-02-07 17:34:56

Stebalien
Member
Registered: 2010-04-27
Posts: 1,239
Website

Re: [SOLVED] awesome automatic mouse movement

client.connect_signal("focus", function(c)
    if mouse.object_under_pointer() ~= c then
        local geometry = c:geometry()
        local x = geometry.x + geometry.width/2
        local y = geometry.y + geometry.height/2
        mouse.coords({x = x, y = y}, true)
    end
end)

Steven [ web : git ]
GPG:  327B 20CE 21EA 68CF A7748675 7C92 3221 5899 410C

Offline

#4 2013-02-07 22:26:05

Kubouch
Member
From: Czech Republic
Registered: 2013-01-03
Posts: 25

Re: [SOLVED] awesome automatic mouse movement

Thorsten Reinbold:
Thanks for the tip. I know about it but I wanted to know, whether there is a solution done in awesome itself.

Stebalien:
That works, thanks! I just copied it into rc.lua and it runs smoohly.

Marking as SOLVED.

Offline

Board footer

Powered by FluxBB