[xmonad] Issue 359 in xmonad: shellPromptHere from XMonad.Actions.SpawnOn doesn't work as claimed

codesite-noreply at google.com codesite-noreply at google.com
Sat Aug 6 02:30:42 CEST 2011


Comment #9 on issue 359 by allber... at gmail.com: shellPromptHere from  
XMonad.Actions.SpawnOn doesn't work as claimed
http://code.google.com/p/xmonad/issues/detail?id=359

If it needs to look for children of the spawned process, two possibilities  
occur to me:

(a) use ps; assume POSIX compliance, or test for BSDish vs. POSIX
(b) there are portable libraries for this kind of thing, although the  
dependencies may get interesting (the most portable one I can think of is  
libgtop...).

Off the top of my head, various Unix-like OSes and the normal ways to get  
at this information:

* Solaris:  libkvm or /proc (note that /proc is not the same as on Linux or  
*BSD)
* *BSD, OS X:  sysctl; libkvm is available for the *BSDs but not OS X
* Linux:  /proc; libkvm is available

libkvm has the difficulty that it usually requires setgid kmem, so you'd  
need a setgid helper program.

It would be better, both for this and for startup notification in desktop  
managers, if someone had had the sense to recognize that a variant of  
_NET_WM_PID that recorded and passed on the pid of the original process  
would be useful, but the free desktop folks seem to have missed that  
notion.  (Hm; maybe the way to go from here is to look at how desktop  
managers do startup notification and borrow that.  I believe it's a  
freedesktop.org standard.)

http://standards.freedesktop.org/startup-notification-spec/startup-notification-0.1.txt
There's also a reference implementation which might be worth interfacing to  
or reimplementing in Haskell.




More information about the xmonad mailing list