0

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...

david
  • 1,302
  • 1
  • 10
  • 21
  • Sorry, but awesome does not provide a signal for when the mouse cursor is moving on the root window – Uli Schlachter Jul 27 '18 at 19:41
  • Thanks for your reply, Uli. I hoped there was another solution with a fewer consumption in CPU resource than xdotool... – david Jul 27 '18 at 21:35
  • 1
    Maybe it is possible with a 1px width wibox on the left side of the left screen and another one on the opposite side on the right screen ? I then capture mouse::enter signal ? – david Jul 27 '18 at 21:51

1 Answers1

1

I give a try to my idea, and it works. Here's the code for my right 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
)

Edit : add Uli's suggestions

david
  • 1,302
  • 1
  • 10
  • 21
  • If you have a compositing manager, you can make that wibar even fully transparent (.opacity = 0). Also, I suggest to add .ontop = true. – Uli Schlachter Jul 28 '18 at 05:41