For your information: I have forked the code at https://github.com/avysk/wmctrl-fork; added some enhancement from the net; and created a FreeBSD port.