[Xmonad] Re: Remote Controlling XMonad: Cases and Materials

Brandon S. Allbery KF8NH allbery at ece.cmu.edu
Tue Jul 31 08:04:04 EDT 2007


On Jul 31, 2007, at 5:37 , Andrea Rossato wrote:

> On Mon, Jul 30, 2007 at 08:47:11PM +0200, Tobias Hammerschmidt wrote:
>>  I like the idea too! Maybe this is a little bit off-topic but why  
>> don't
>>  use a standard like dbus? There are allready some haskell  
>> bindings out
>>  there (http://neugierig.org/software/hdbus/ -- ok they were not  
>> updated
>>  for about a year but maybe it could be a point to start from  
>> though).
>
> well, we could have a look at dbus too, but the problem is finding a
> way to listening for external commands without blocking XMonad (which
> is already blocked, in the "forever" loop, by nextEvent).

I would say that passing commands through the X server is *the*  
correct way to communicate between X11 clients, including between a  
window manager and another client; it is what relates them to each  
other.  Unfortunately, while the ideal way to do it is XSendEvent,  
that is a seriously broken and insecure API --- hence the use of  
properties.

That said, you might want to look at http://sequence.complete.org/ 
node/257 for an example of selecting on multiple connections, using a  
command channel socket and the X11 ConnectionNumber($display) macro.   
(Just be careful to do all other X11 actions in the main thread; only  
forkIO the listener on ConnectionNumber, not the actual X11 actions.)

-- 
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery at kf8nh.com
system administrator [openafs,heimdal,too many hats] allbery at ece.cmu.edu
electrical and computer engineering, carnegie mellon university    KF8NH




More information about the Xmonad mailing list