This is a work in progress VNC client written in Self. The current status is that it can connect to a VNC server that has no authentication and display the screen contents in a Morph.
To start a VNC session I did the following on Ubuntu:
- Install tightvncserver.
- Copy /usr/bin/vncserver to a temporary location.
- Edit my copy of vncserver to remove the line that sets
$authType
. - Start with:
./vncserver -geometry 640x480 :1
Load the vncViewer module using the transporter trees system by running the following from within Self:
modules init
registerTree: 'doublec_vncviewer'
At: 'path/to/self-vncviewer'.
bootstrap read: 'vncViewer'
From: 'applications'
InTree: 'doublec_vncviewer'.
modules vncViewer tree: 'doublec_vncviewer'.
To connect from Self:
- Display the
vncViewer
object as an outliner. - From an evaluator on that object, run
connect
- From an evaluator run
attachMorph
usingget
so you get the result in your hand. - Place the resulting outliner on the desktop, right click and choose
Show Morph
. - Place the Morph on the desktop.
You should now see the VNC session in the morph. If you run a VNC client and use the VNC session you should see the Self Morph update to reflect this.
An animated GIF of these steps can be seen below:
The Self code is based on the RFB specification. Not all of it is implemented and those parts (like VNC authentication) have missing methods. The intent of this was for the debugger to appear for unimplemented parts of the spec and to implement them in the debugger and continue. This is how most of the existing code was written.
To make changes:
Middle clicking the desktop will bring up a menu with 'Changed Modules' as an option. Click that to show the changed modules morph. When the vncViewer code is edited this will show that the module has changed. Pressing the 'W' or 'W All' will write those changes to the directory specified in the registerTree
for the doublec_vncviewer
tree that was registered above. The standard git
tools can then be used to show diffs, commit, etc.