]> git.madduck.net Git - etc/awesome.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Move mouse pointer to area only if not already within
authormartin f. krafft <madduck@madduck.net>
Tue, 27 Feb 2018 03:13:12 +0000 (16:13 +1300)
committermartin f. krafft <madduck@madduck.net>
Tue, 27 Feb 2018 03:13:12 +0000 (16:13 +1300)
.config/awesome/rc.lua

index 3c7cdf34cc7c8944c1d4038fe845460d63e9d0f3..4a1632905614c2d3dcf5bc6df3a4c9f4821ac7e0 100644 (file)
@@ -115,11 +115,18 @@ local function set_wallpaper(s)
     end
 end
 
     end
 end
 
-local function centre_mouse_on_area(a)
-    mouse.coords({
-        x = a.x + a.width/2,
-        y = a.y + a.height/2,
-    }, true)
+local function move_mouse_to_area(a)
+    local coords = mouse.coords()
+    if (coords.x < a.x or
+        coords.x > (a.x+a.width) or
+        coords.y < a.y or
+        coords.y > (a.y+a.height)) then
+
+        mouse.coords({
+            x = a.x + a.width/2,
+            y = a.y + a.height/2,
+        }, true)
+    end
 end
 
 -- }}}
 end
 
 -- }}}