Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: no.top.post@gmail.com Newsgroups: linux.dev.kernel,comp.os.linux.development.system,de.comp.os.unix.linux.misc Subject: HOW2 find Desktop,VT corresponding to pid. Date: Sun, 24 Apr 2011 11:27:09 +0000 (UTC) Organization: A noiseless patient Spider Lines: 39 Message-ID: Injection-Date: Sun, 24 Apr 2011 11:27:09 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="RWPy9AQCGh1mPgxUNZ1apA"; logging-data="20557"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX180Uz/tXj0MaVxWcw3by7plZMThUOZPAZU=" X-Mailer: Oberon Mail (ejz) on ETH Oberon (2.4.3) for Linux x86 Cancel-Lock: sha1:f5TV8kSuVPmD0/sLkto3XZGSGmE= Xref: x330-a1.tempe.blueboxinc.net comp.os.linux.development.system:101 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 --> lsof | cut -c11-14 == shows the list of pid for -> lsof | grep