Sometimes I want to bring all the windows of one application to the top. It seems that the only way to do this in Unity currently is to switch to each window individually (either by using alt-tab, clicking on the launcher icon and selecting each window, or minimizing all other windows). I'm guessing it's possible to hack something together using wmctrl to do this but I'm hoping for a simpler solution.


3 Answers 3


You can use wmctrl for this:

There is a shortcut for all windows, e.g. if you just want to undo going to the desktop:

wmctrl -k off

If you really need to bring up just a specific app, you can use a script, as follows, but it will bring up all windows on all workspaces. E.g. to bring up all gnome-terminals, you could do

pids=" $(pidof gnome-terminal) "
wmctrl -lp | while read id a pid b; do
  test "${pids/ $pid }" != "$pids" && wmctrl -i -a $id

If you just need to find all the windows of an application (with a preview of the contents in each) then click the app's icon twice in the launcher bar. The first time you click it will make the most recent window of the app active and the second time it will give you a preview of all the app's windows. That isn't technically the same as "bringing them to the top" but might meet the actual need you have (to find all the open email windows for example).


Building on @Lajos' excellent answer to work with any app:

function showall {
  pids=" $(pidof $1) "
  wmctrl -lp | while read id a pid b
  do test "${pids/ $pid }" != "$pids" && wmctrl -i -a $id; done

Then call it like this:

showall gnome-terminal
showall nautilus
showall chrome

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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