Message passing between instances

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Message passing between instances

Chris Bell
Hi all,

I'm currently using multiple boxes in a convoluted extended desktop setup
using Synergy. I have a script which, when I start X on the main box,
connects via SSH to the secondary boxes and starts X and Xmonad. Then
Synergy takes over and I can control all of the desktops from a single
kbd/mouse. Overall, it seems to be working surprisingly well.

I'm having trouble automating event/action synchronization post-startup.
Specifically, I want to quit the Xmonad sessions on the secondary boxes
when the primary quits. I have this currently implemented by killing the X
server over ssh; an action about as graceful as throwing a brick through a
window.

Is there a builtin way to pass messages between Xmonad instances? So that,
when I exit on the primary, it sends an 'exit' command to the secondaries,
which then clean up and close. Preferably, I would like to extend this to
synchronize xscreensaver activation, but that's not a major concern.

If there isn't a builtin method, can anyone recommend a third-party
application/feature which I can use to implement such functionality? I keep
persistent SSH connections between the primary and all secondaries, so
commands can be passed as necessary.

All three boxes are running Xmonad 0.11 on bare metal - no desktop/session
manager. Synergy setup and X initializations are done via a custom startx
script.

Thanks for all your help!

Chris Bell

Ph.D. Candidate, Teaching Assistant, Gentleman, Scholar, Penguin Wrangler
University of South Florida
College of Engineering
Department of Computer Science and Engineering
NarMOS Research Team, Official Daemon Charmer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/xmonad/attachments/20150407/8f190635/attachment.html>

Reply | Threaded
Open this post in threaded view
|

Message passing between instances

Brandon Allbery
On Tue, Apr 7, 2015 at 3:23 PM, Chris Bell <cwbell at mail.usf.edu> wrote:

> Is there a builtin way to pass messages between Xmonad instances? So that,
> when I exit on the primary, it sends an 'exit' command to the secondaries,
> which then clean up and close. Preferably, I would like to extend this to
> synchronize xscreensaver activation, but that's not a major concern.
>

XMonad.Hooks.ServerMode is a proof-of-concept that needs some work to be
practical (IIRC it can rearrange some commands if you add workspaces
dynamically, and has other problems).

xscreensaver has a remote-control protocol of sorts already; see
xscreensaver-command.

--
brandon s allbery kf8nh                               sine nomine associates
allbery.b at gmail.com                                  ballbery at sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/xmonad/attachments/20150407/0d5664dd/attachment.html>

Reply | Threaded
Open this post in threaded view
|

Message passing between instances

Chris Bell
On Tue, Apr 7, 2015 at 4:05 PM, Brandon Allbery <allbery.b at gmail.com> wrote:
> XMonad.Hooks.ServerMode is a proof-of-concept that needs some work to be
> practical
Fantastic, thanks! I don't mind impractical; as long as it's not
impossible. The 'quit-wm' function seems to work well enough as-is in
my brief testing. At the moment, I'm only using simple commands, so
hopefully it should prove 'practical enough'.

> xscreensaver has a remote-control protocol of sorts already;
Thanks for the heads up. I completely missed the `-display host:disp`
argument: that should do exactly what I want.

Thanks again for the help!

Chris Bell

Ph.D. Candidate, Teaching Assistant, Gentleman, Scholar, Penguin Wrangler
University of South Florida
College of Engineering
Department of Computer Science and Engineering
NarMOS Research Team, Official Daemon Charmer