The vala experiments

This page contains some vala code that I wrote as a test bed for other programs or just because I want to better understand some vala functionality.

S.n.u.l.

Snul is a simple network utility library I wrote to replace gnet library dependency from Tuntun the successor of ovpnClient. It implements just a simple and minimalistic tcp socket client and I estimate to replace it with Gio library whenever it will do tcp streams.

For this reason I consider snul a quick, simple and provisory hack and I advise everyone to stay away from it and use only if necessary 🙂

Be aware, Snul actually requires vala compiler version 0.1.7 to compile.

 

XChat Plugins in Vala

This is my “successful” attempt to write an XChat plugin in vala. Even if it’s not optimal from the vala style point of view, it works pretty well, so I think that could be useful to someone else too.

How to compile and use:

  1. download the tarball
  2. extract it to some folder
  3. compile using make
    • the only dependency is glib 2.0, so be sure that the corresponding dev package is installed
  4. copy the resulting xchat-helloworld.so in ~/.xchat2/plugins/
  5. run xchat or xchat-gnome (I tested it only with xchat-gnome, but it should works with normal xchat too)
  6. enable the plugin from xchat preferences dialog
  7. now if you type /help in your chat window, you should have a new command: HELLO_WORLD
  8. so type it and enjoy the result!

The vapi file could be greatly improved, especially the init and get_info functions are great candidate to become virtual methods, but first I need to investigate on how vala supports virtual methods on classes that aren’t gobjects.

XChat PASTEBIN Plugin in Vala

After some time I wrote a useful plugin (at least for me) with my xchat vapi files. It’s a pastebin extension for xchat-gnome, that simply post your clipboard (or primary selection) to pastebin.com and write the resulting link in the current chat window.

XChat Pastebin thumbnail

 

To compile and use, dowload it and follow the instructions written in the README file.

5 thoughts on “The vala experiments”

Leave a Reply

Your email address will not be published. Required fields are marked *