lunes, 18 de julio de 2011

Running devwsys

The most straightforward way to use devwsys is from 9vx. First, devwsys have to be launched:

user@unix$ devwsys
This will post a 9p server in /tmp/ns.user.:0/wsys (where user is the user name in the unix system and :0 is the current X display). Now, this 9p server can be mounted from 9vx to create new windows. An easy way to access devwsys is setting the wsys environment variable. Then, you will be able to open programs in new windows using window(1) with the -m flag:

term% wsys='#Z/tmp/ns.user.:0/wsys'

term% window -m acme
For a better experience the wctl rc script, included in the util directory of the devwsys distribution, can be used to provide a wctl service. Then, the -m option is not needed any more, new applications will use the namespace of the wctl process:

term% wctl=`{wctl}


term% window acme
Similar commands will work from drawterm(8) too. Inferno, instead, is a bit different. Some files have different names, and cursors have a slight different format. To solve this issue, devwsys will deduce what cursor format is being used depending on what is written to the cursor file, while extra keyboard and pointer files are equivalent to cons and mouse. So, the only required step is to mount devwsys before launching wm(1):

; mount -Ab '#U*/tmp/ns.user.:0/wsys' /dev

; wm/wm
Have fun!

6 comentarios:

  1. I've been playing with this a bit, and it's really advanced the possibilities greatly. Well worthwhile. I realise there are things to sort out, but it's well beyond simply encouraging.

  2. I really look forward to playing with this. One question: How tied to Xlib is devwsys and is it easy to port to other abstractions (directfb, wayland (alternatively via cairo, Qt), cocoa etc)?

    Another question is if this could also be used for Wmii to provide the 9P server for that desktop environment? Could multiple "clients" (inferno, plan9port, 9vx and wmii for example) seamlessly interact via a common devwsys?

  3. It looks like I cannot reply to a single comment, just write a new one. *sigh*

    All the X11 code is contained in the devwsys/x11 directory. To port devwsys to other graphic system the only thing you have to do is to implement the x.* functions declared in devwsys/fns.h.

    I'm not sure I understand your second question. Devwsys can be used by Inferno, 9vx or any other client at the same time, but I don't see how wmii could be a client.


    I have not experimented with it myself but it would ofcourse be quite nice with an integrated desktop :)

  5. Jens,

    I know wmii and its 9P capabilities. Both wmii and devwsys are 9P servers, but that's everything they have in common. I still don't understand what kind of integration you are thinking about. Could you give an example of what you have in mind?

  6. I do not know exactly how this thing you are building actually will work, but I imagined it as a common /dev/draw over 9P for Inferno, p9p, 9vx etc. In my simple mind, I just thought that it then would be nice if they all also could run "seamlessly" (in a graphical sense) by writing to a common file system.
    Since I do not know exacly what wmii does, I might have misunderstood that one but I sort of just imagined that one as also being able to integrate in the same way (reading and writing window information to a common file system).

    On the other hand - I am just brain farting. Imagined how it might work and just thought a bit further... Sorry for that :)