9

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.

2

3 Answers 3

2

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
done
1

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).

1

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .