HOW2 find Desktop,VT corresponding to pid.

24/04/2011 - 13:27 von no.top.post | Report spam
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 the 'picture' of `pstree -p`used
some other char than "-" to draw "-", and different code
would have been needed.

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].
So I couldn't program the system to 'see it'.

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.

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 | grep <thatSame pid>
 

Lesen sie die antworten

#1 Realname [m]
24/04/2011 - 22:33 | Warnen spam
Am 24.04.2011 13:27, schrieb :
[...very hard to understand, not to say "babble"...]

My tips to get as few answers as possible:
- Never use a realname.
- Never use a replieable adress.
- Crosspost to even more hierarchies.
- Use as much inapprehensible abbreviations as possible.
- Always use the wrong group.
- Definitly make sure nobody understands your problem.


HTH

Realname [m], Avenger of the clueless

Ähnliche fragen