Ubuntu – How to bring all windows of an application to the front

12.04unitywindow-manager

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.

Best Answer

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
Related Question