czerny
czerny

Reputation: 16684

Get window pid in Looking Glass extenstion of Gnome Shell

Looking Glass debugger of Gnome Shell provides Windows tab that lists all opened windows. Instance of such windows can be referenced from Evaluator tab after clicking, for example: [object instance proxy GType:MetaWindowX11 ...]

How can be process id of process of the selected window obtained in Evaluator tab?

There is get_client_pid() method defined in Mutter project, however it can't be called directly.

Upvotes: 1

Views: 605

Answers (2)

frog.ca
frog.ca

Reputation: 732

In Looking Glass:

  • Click on tab "Windows".
  • Select the desired window.
  • Scroll down, looking for "get_pid()".
  • Scroll to tab, click on "Insert" button.
  • Click on tab "Evaluator".
  • In bottom text field enter last output "r(x)" followed by ".get_pid(), for example "r(0).get_pid()", press Enter/Return.
  • Note the output, which is the process ID.

Upvotes: 0

4levels
4levels

Reputation: 3234

I'm just from asking something very similar on the Gnome Shell IRC, this is what I found out from the very helpful folks there:

I you open Looking Glass and click the Insert button in the upper right corner (eg. after selecting a window from the Window list), you'll get something like r(x) = ... in the evaluator (with x being a sequential number). You can then call any method on the object like so: r(1).get_window_type()

Hope this helps!

Kind regards,

Upvotes: 0

Related Questions