The easiest way to do this would be to shell out to wmctrl . You should read
man wmctrl to see how to use it.
You could basically bind the command line to a 'Window' class and add methods to it that use wmctrl commands in the background.
@@windows = 
`wmctrl -l`.split("\n").map do |str|
@@windows << self.class.new(str.split(' ')*)
def initialize window_id, desktop_id, client_machine, window_title
#set up object here
#add other methods here
That should be a good starting point. It's not tested or anything but you should be able to work it out from here. You could now add instance methods, eg.
change_geometry, which could utilise the
-r <WIN> -e <MVARG> option.
You should familiarise your self with pipes and IO in general before doing this.
Perhaps when you have accomplished what you need to, you can distribute this as a ruby library and package it for Debian/Ubuntu.