lerner
Posts: 510
Joined: Sun Mar 29, 2015 12:12 am

WMCTRL command help please.

Sun Nov 26, 2017 9:34 pm

Folks,

I am trying to get my head around using this command: wmctrl.

What I am wanting to do is have a command to force the terminal window to the front.

From what I see that is "easy" in you do the command:

wmctrl -r <window name> -b add,above

Ok, got it. But if I want THIS WINDOW as the window name, how do I do that?

I can't quite work out the quirkyness of linux yet to understand that part.

Is it possible?

Thanks in advance.



P.S.

I also understand that I will probably have to then toggle/remove the "above" so the window isn't stuck above all others.

User avatar
topguy
Posts: 6356
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: WMCTRL command help please.

Mon Nov 27, 2017 11:59 am

Ok, got it. But if I want THIS WINDOW as the window name, how do I do that?
I'm not sure what you are asking, are you asking how to set the window name when you open a terminal window ? Or how to replace "window name" in the wmctrl command. ( TIP: your not supposed to include < > )

Personally I prefer the xdotool. http://www.semicomplete.com/projects/xdotool/

lerner
Posts: 510
Joined: Sun Mar 29, 2015 12:12 am

Re: WMCTRL command help please.

Mon Nov 27, 2017 8:29 pm

Hi.

The "idea" is that have an open (RANDOM) terminal/CLI. By that I mean one I don't want to have to name. The path is also not to be anything specific. It could be Anywhere.

I start some task and it is going to take some time. Say: sudo apt update

I don't want to have it at the top all that time.
So I get on with other things.

So.... After the command I && a new command so when it is done, it brings that window to the front.

WMCTRL can do that to a "named" window - which can be the one in which it is launched. But on the proviso that THAT window's name is known.

So I am asking is it possible to use WMCTRL to bring the window in which it is run to the front?

From what I have read xdotool has the same limitation: In that it can't execute commands on it own window unless it knows the name.

I'll have a look at the link anyway, but as I said: From what I read that needs the window name too.

:(

Return to “Beginners”