Last active
August 29, 2015 14:10
-
-
Save Schroedi/45d6af3f4500df76459d to your computer and use it in GitHub Desktop.
sloppy mouse for tag switching in awesome wm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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