Using the XDo gem to control mouse and window movement in the X11 environment

Installation

gem install xdo

Example

require "xdo/mouse"
require "xdo/keyboard"
require "xdo/xwindow"

XDo::Mouse.move(100, 100)
XDo::Keyboard.simulate("AB{ESC}c") #Sends A, B, [ESC], and c
xwin = XDo::XWindow.from_search("README")
xwin.move(25, 25)
xwin.close

This gem relies upon the package xdotool which was installed on my Debian system by default.

Resources