You are not logged in.

#1 2009-09-15 17:24:10

atordo
Member
Registered: 2007-04-21
Posts: 147

Reading X Window caption of a process

This must be answered a gazillion times, but the very generic terms "window" and "caption" render a lot of false positives for search.

Providing I know the pid of a process running in X, is it possible to retrieve its window caption/title? No dcop or other fancy stuff.

Preferably in sh or perl, but anything will do.

Offline

#2 2009-09-15 18:11:07

urandom
Member
From: Russia
Registered: 2007-10-01
Posts: 19
Website

Re: Reading X Window caption of a process

xwininfo can do it by window ID. I think you solve your problem, after inspecting its sources smile

Offline

#3 2009-09-15 20:37:40

atordo
Member
Registered: 2007-04-21
Posts: 147

Re: Reading X Window caption of a process

Thanks for the tip, I didn't know that command (I'm a total noob at X programming). It seems a good starting point for further investigation.

Offline

#4 2009-09-15 21:56:42

atordo
Member
Registered: 2007-04-21
Posts: 147

Re: Reading X Window caption of a process

I downloaded the sources but after some reading I opted for the easy dirty solution: a xwininfo -root -tree (lists all windows) with some greps in bash smile

Maybe I polish it from the C sources if I have the time, but for the time being, albeit ugly, it's working.

BTW, freedesktop.org mirrors are a total mess, after several unsuccessful attempts I had to download the tarball from the main server.

Offline

Board footer

Powered by FluxBB