Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I wrote a nice little script that changes my monitor outputs according to whether an external monitor is connected or not and whether the laptop lid is open or closed or not and so on.

That works pretty well, the only thing is that when my big external monitor is unplugged the windows on the laptop screen exceed the workspace so that I would have to resize or reopen all windows first.

I am looking for a shell command or something that does this for me; it should just resize all windows so that they fit in the workspace.

Is this integrated in XFCE4? Or do I need some other program?

PS: I am using compiz as window manager and emerald for the decorations.

share|improve this question
up vote 2 down vote accepted

You can use xdotool, which is a command line tool for manipulating X windows, so it should work with every window manager and every desktop environment.

share|improve this answer
But you might add a link to xdotool. – Keith May 19 '11 at 8:56
good point, added the link. You won't need to download it manually though, as there should be packages for most ditributions. – Kim May 19 '11 at 9:13

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.