I'm trying to find a way to raise all the windows that have one, specific title.

For example, I have two windows named superconky (yes, you guessed it, I'm trying to get conky running in lubuntu).

I have a command I got from the LXDE forums: sh -c 'wmctrl -k on; wmctrl -a superconky;'

I use it to show the desktop, except conky. It works perfectly, but only if you have one conky. If you have two or more, you get left with one and all the others minimized.

So, what should I do to raise all the windows?

Thanks in advance.

1 Answer 1


"So, what should I do to raise all the windows?"

Presumably you mean all the conky windows?

Since wmctrl is not doing what you want by specifying the window name, you should use the more exact method of speciying the window id.

To get the list of window ids one does

wmctrl -l

So assuming your windows have superconky in the title, to extract just the window ids from that list

windowid_list="`wmctrl -l | sed -ne 's|^\([^ ]*\).*superconky.*|\1|p'`"

Then process the list

if [ -n "${windowid_list}" ]
     for windowid in ${windowid_list}
         wmctrl -i -a "${windowid}"

Take note that the "-i" flag to denote a numeric windowid must be specified before the action flag ("-a", "-R", or whatever) or nothing happens.

Also take note that "-a" raises and focuses the window and that only one window can be focused at a time.

Also, if the second superconky window is directly underneath the first one, when the second one is raised, it will obscure the first.

  • Thank you! Worked like a charm! Just one little thing: for the ease of use, could this be converted into a one-liner? If yes, it would be absolutely perfect. Jul 9, 2014 at 19:29
  • @DoctorJellyface to shorten this you can create your own function and add it to the ~/.bashrc file.
    – TuKsn
    Jul 9, 2014 at 21:06

You must log in to answer this question.

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