Skip to content

Instantly share code, notes, and snippets.

@Schroedi
Last active August 29, 2015 14:10
Show Gist options
  • Save Schroedi/45d6af3f4500df76459d to your computer and use it in GitHub Desktop.
Save Schroedi/45d6af3f4500df76459d to your computer and use it in GitHub Desktop.
sloppy mouse for tag switching in awesome wm
-- global timer that runs once and focuses the window currently under the mouse pointer
sloppytimer = timer({ timeout = 0.01 })
sloppytimer:connect_signal("timeout", function()
c = awful.mouse.client_under_pointer(screen)
if c then
client.focus = c
c:raise()
end
sloppytimer:stop()
end)
-- start the timer every time we change tags
-- add layouttimer:start() to your key bingdings like this:
awful.key({ modkey }, "#" .. i + 9, function ()
local screen = mouse.screen
local tag = awful.tag.gettags(screen)[i]
if tag then
awful.tag.viewonly(tag)
-- starting sloppy mouse timer
sloppytimer:start()
end
end),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment