Discovering the package of an open window

Jonathan Lange jml at canonical.com
Fri Jan 18 16:42:50 UTC 2013


On 18 January 2013 16:39, Michael Spencer <spencers1993 at gmail.com> wrote:
> What is the best way to discover the package a program is in by clicking
> on an open window?
>
> So far I've been using xprop to get the PID of the window, reading where
> /proc/<PID>/exe points too, and then running apt-file search on that.
>
> However, for some programs, like LibreOffice Writer, I get
> libreoffice-core, not libreoffice-writer.
>
> For the program I'm writing, Contributor Console (written in python),
> the executable is /usr/bin/python2.7, even though I launched it with the
> command contributor-console.
>
> So, what is the best way to accurately discover the package a program is
> in by clicking on an open window?
>

I have a really crappy program that already does this at:
    https://launchpad.net/start-hacking

A quick look at the code should answer your question.

cheers,
jml




More information about the Ubuntu-devel-discuss mailing list