Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.linux.development.apps > #101

Re: HOW2 find Desktop,VT corresponding to pid.

From James Waldby <not@valid.invalid>
Newsgroups alt.os.linux.mandrake, comp.os.linux.development.apps
Subject Re: HOW2 find Desktop,VT corresponding to pid.
Date 2011-04-28 14:06 +0000
Organization A noiseless patient Spider
Message-ID <ipbs8e$ojs$1@dont-email.me> (permalink)
References <ip11fj$mqh$1@dont-email.me>

Cross-posted to 2 groups.

Show all headers | View raw


On Sun, 24 Apr 2011 11:27:55 +0000, no.top.post wrote:

> I need to have a table:
>  mapping the (Desktop,VT): pair having mc open, to it's path. So: 4,3  
>  /mnt/p6/Debug/dog
> means that whe 'data arrives for /mnt/p6/Debug/dog', I need to switch to
> Desktop:4, VT:3.
>  
> Previously I wrote a utility which gets all mc paths from `lsof | grep
> mc`, with the corresponding pid/S; and 'examines the graph drawn' by
> `pstree -p`; and from the position of the 'mc branch' in `pstree -p`
> could determine the D,V: pair, having the pid corresponding to the path.
> So via 2 stages, I could map the path to the D,V.
> 
> That worked OK for Mandrake 9. > For FC1 it failed, because [...]
> Now I've got Slak13, and the `pstree -p`representation is completely
> different, so that I can't see the D,V corresponding to the pid [so
> far].[...]
> OTOH, the system must know 'which file is open in any D,V'.
> I've browsed around /proc, but I can't see how to solve this.

Likewise - In a brief look on linux 2.6.35.12-88.fc14 system, I 
don't see any window info in process's /proc subdirectory.

> Since D & V are 'attributes' of the window manager, probably this is a
> wm problem.
> The method that I eventually got working nicely, was under KDE3, but now
> I want to use Xfce.
> 
> == TIA.
> -> try: lsof | grep <knownPath>
> -->  lsof | cut  -c11-14 == shows the list of pid for <knownPath> ->
> lsof | grep <thatSame pid>

Maybe try
    wmctrl -lp | grep $pid   
to get the window id for a given pid, and perhaps
    wmctrl -a $windowid  
to give the window the focus.  The wmctrl manpage says it's Xfce 
compatible and also suggests zenity "for building scripts with wmctrl"

-- 
jiw

Back to comp.os.linux.development.apps | Previous | NextPrevious in thread | Find similar


Thread

HOW2 find Desktop,VT corresponding to pid. no.top.post@gmail.com - 2011-04-24 11:27 +0000
  Re: HOW2 find Desktop,VT corresponding to pid. James Waldby <not@valid.invalid> - 2011-04-28 14:06 +0000

csiph-web