summaryrefslogtreecommitdiff
path: root/awesome/warpcursor.lua
diff options
context:
space:
mode:
authorTimmy Keller <tjk@tjkeller.xyz>2024-09-28 22:47:28 -0500
committerTimmy Keller <tjk@tjkeller.xyz>2024-09-28 22:47:28 -0500
commit9d7c46cb29293c5f553f1204c25d9afa7506f8c2 (patch)
tree34f95a3eae0c0adacd3d766c4478195f0c8d32d3 /awesome/warpcursor.lua
parentad8a5145c3db84ae34d2f475eff35427640ba64b (diff)
parentd1f9ee5eced0c273de6c598f88ddb0f7b4e54230 (diff)
downloaddotconfig-9d7c46cb29293c5f553f1204c25d9afa7506f8c2.tar.xz
dotconfig-9d7c46cb29293c5f553f1204c25d9afa7506f8c2.zip
Merge branch 'master' of localgit:dotconfig
Diffstat (limited to 'awesome/warpcursor.lua')
-rw-r--r--awesome/warpcursor.lua22
1 files changed, 22 insertions, 0 deletions
diff --git a/awesome/warpcursor.lua b/awesome/warpcursor.lua
new file mode 100644
index 0000000..f1a46bd
--- /dev/null
+++ b/awesome/warpcursor.lua
@@ -0,0 +1,22 @@
+function warp_cursor(c)
+-- if c ~= client.focus or not c.warp_cursor then
+ if not c.warp_cursor then
+ return
+ end
+
+ -- dont allow moving mouse unless it is over another client or over nothing
+ local canmovemouse = mouse.current_client or (mouse.current_wibox or mouse.current_widget) == nil
+
+ if canmovemouse and mouse.current_client ~= c then
+ mouse.coords {
+ x = c.x + (c.width / 2),
+ y = c.y + (c.height / 2),
+ }
+ end
+end
+
+client.connect_signal("focus", warp_cursor)
+--client.connect_signal("property::size", warp_cursor)
+--client.connect_signal("property::position", warp_cursor)
+
+return warp_cursor