You are not logged in.
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
Have a look at xdotool. Sounds like it could fit your needs perfectly.
Offline
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)
Offline
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