You are not logged in.

#1 2009-10-26 21:28:42

poopship21
Member
Registered: 2009-05-13
Posts: 177

client focus awesome wm

i have the bad habit of using keyboard to navigate among awesome clients and forgetting that the mouse in an inconvenient position (ie conferring focus to the client that it is positioned over rather than the one which i have chosen with mod4+j/k).  i have perused the rc.lua file briefly but im not that familliar with the object model of awesome (at least the way its defined there) so im reluctant to hack away if someone else has a cut and paste solution.  awesome is awesome, but its an acquired taste.
TIA

Offline

#2 2009-10-26 21:55:21

anrxc
Member
From: Croatia
Registered: 2008-03-22
Posts: 834
Website

Re: client focus awesome wm

Focus follows the mouse, or in this case a slight variant called sloppy focus. It is nothing specific to awesome practically every window manager has it, and awesome is distributed with a default rc.lua where it is enabled.

Open your rc.lua and search for "sloppy focus", you can't miss it, then comment it.


You need to install an RTFM interface.

Offline

#3 2009-10-27 18:26:37

poopship21
Member
Registered: 2009-05-13
Posts: 177

Re: client focus awesome wm

that worked, thanks anrxc.  however it would be convenient to be able to toggle soft focus as the need arises.  i tried to edit the rc.lua file to incorporate this functionality but it seems the soft focus is still disabled (like i want it to be 99% of the time) when i try to enable it with "modkey+Shift s"

global variable to tell awesome whether the follow the mouse:

makesloppy = 1

added global keybinding for toggling makesloppy

    -- Toggle Sloppy focus
    awful.key({ modkey, "Shift"   }, "s",
        function ()
            if makesloppy then
                makesloppy = 0
            else
               makesloppy = 1
            end
        end)
)

in the hooks section which you pointed out earlier, added a conditional to the focus statement

awful.hooks.mouse_enter.register(function (c)
    -- Sloppy focus, but disabled for magnifier layout
    if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier
        and awful.client.focus.filter(c)
            and makesloppy then
                client.focus = c
    end
end)

my stupid mistake is going to pop right out at you!
smile

Last edited by poopship21 (2009-10-27 18:28:25)

Offline

#4 2009-10-27 20:24:42

anrxc
Member
From: Croatia
Registered: 2008-03-22
Posts: 834
Website

Re: client focus awesome wm

Don't use 0 and 1, use true and false.

Edit: since I'm already answering, you can also simplify your function, instead of the if statement use: makesloppy = not makesloppy

Last edited by anrxc (2009-10-27 20:30:01)


You need to install an RTFM interface.

Offline

#5 2009-10-27 23:38:17

GGLucas
Member
Registered: 2008-03-13
Posts: 113

Re: client focus awesome wm

Another way to do this is to add cursor warping to your configuration, it's a bit more complex but what you basically need to do is move the cursor to the new window whenever you change focus using the keyboard (with some sanity checks so you don't get your pointer jumping all over the place when you're actually using the mouse).

I wonder why they didn't include an example of that in the default config.

Offline

#6 2009-11-26 16:56:32

poopship21
Member
Registered: 2009-05-13
Posts: 177

Re: client focus awesome wm

GGLucas wrote:

Another way to do this is to add cursor warping to your configuration, it's a bit more complex but what you basically need to do is move the cursor to the new window whenever you change focus using the keyboard (with some sanity checks so you don't get your pointer jumping all over the place when you're actually using the mouse).

I wonder why they didn't include an example of that in the default config.

thats intruiging.  i didnt get any results searching the wiki for cursor warping so i guess im going to start a bit lower:

[au@arroyo1 ~]$ grep -Hlr "cursor" /usr/share/doc/awesome/luadoc/
/usr/share/doc/awesome/luadoc/modules/awful.completion.html
/usr/share/doc/awesome/luadoc/modules/root.html
/usr/share/doc/awesome/luadoc/modules/awful.mouse.html
/usr/share/doc/awesome/luadoc/modules/wibox.html
/usr/share/doc/awesome/luadoc/modules/awful.mouse.finder.html
/usr/share/doc/awesome/luadoc/modules/awful.prompt.html
/usr/share/doc/awesome/luadoc/modules/awful.tooltip.html

ill post results once i have it implemented.  note that implementation is attenuated by consumption of turkey wink

Offline

#7 2009-11-26 20:35:22

anrxc
Member
From: Croatia
Registered: 2008-03-22
Posts: 834
Website

Re: client focus awesome wm

Awesome 3.4.x now emits an arrange signal, which makes it easier. You'll find the rc.lua part of code here
http://www.mail-archive.com/awesome@naq … 02037.html


You need to install an RTFM interface.

Offline

Board footer

Powered by FluxBB