首页 > 解决方案 > Mouse cylinder behaviour (dual-screen config)

问题描述

I've already asked a question about this in Unix & Linux SE and I so actually use xdotool.

The idea is that the mouse goes at the left of the left screen when it reaches the right of the right screen and vice versa.

But I recently saw the mouse.coords table in the awesome API, so I'd like to give up xdotool to set mouse coordinates as do xdotool with this possibility.

I suppose I should add a signal to the root to know when the mouse is on the edge, but I don't konw how to do this...

标签: luamousemultiple-monitorsawesome-wm

解决方案


我尝试一下我的想法,它奏效了。这是我正确的 wibox 的代码:

s.myjumpbox = awful.wibar({
      position = "right",
      screen  = s,
      width   = 1,
      opacity = 0,
      ontop   = true,
      -- bg      = beautiful.noir
})                                                                  
s.myjumpbox:connect_signal("mouse::enter", function(w)              
      mouse.coords {
          x = 2 ,
          y = mouse.coords().y
      }
      end
)

编辑:添加 Uli 的建议


推荐阅读