I am writing a python script to resize and organize windows, just like the grid
plugin does in compiz-fusion
(except that I am on Debian Wheezy).
I am using xrandr
and wmctrl
to get the resolutions of my two screens and compute custom sizes for windows (split horizontally, vertically, etc...):
xrandr
tells me how many screen I have and their resolutionswmctrl
gives me original sizes of windows and their location (on which workspace they are displayed)
Unfortunately my 2 screens don't have the same resolution at all, so the only information I am missing is: on which screen the windows is currently displayed so that I can compute new sizes that fit gracefully in this screen.
Is there any command/program that could get this info ?
xdotool
but unfortunately it is not aware of the dual screen setup, all it can see is a single big screen. Indeedxdotool getmouselocation
always displaysscreen:0
even if I move my mouse around both screen...