dominictarr / tiles

MIT License
62 stars 6 forks source link

consider to use ntk instead of node-x11 #1

Open sidorares opened 10 years ago

sidorares commented 10 years ago

Hi Dominic! I've always wanted to implement functional wm with node-x11, very happy to see that you actually found time to do this! I'll be happy to collaborate

node-x11 is intentionally very low level and only exposes X11 requests / events. I created wrapper library around it - https://github.com/sidorares/ntk - what do you think about using it instead x11 directly?

This is simplest possible wm in ntk:

require('ntk').createClient(function (err, app) {
  app.rootWindow()
    .on('configure_request', function(ev) {
      // add code to resize target window 
     })
   .on('map_request', function(ev) {
    ev.window.map();
    });
})

or with coffee:

require('ntk').createClient (err, app) ->
  app.rootWindow()
    .on 'configure_request' (ev)->
       // resize
    .on 'map_request' (ev)->
      ev.window.map()
dominictarr commented 10 years ago

Oh, great! I was basically implementing this within tiles, but you have done pretty much exactly what I was gonna do anyway.

I do have on suggestion, but I'll post that as an issue on ntk

https://github.com/sidorares/ntk/issues/1