As part of my current duties at Canonical I have to deal a lot with different parts of the Linux middleware stack. GSettings, dconf, PulseAudio...
Most of what I do these days is Vala and C (preferably Vala) and once I started dealing with NetworkManager I noticed the lack of Vala bindings for the GObject wrappers. My first reaction was to just write the whole thing in C but eventually I figured the whole thing was easier to maintain if I just took a week to write the bindings.
After a few bug fixes upstream in Vala and NetworkManager, the Vala bindings are now part of NetworkManager upstream.
Here's an example on how to get all driver names for each device:
1 2 3 4 5 6 7 8 9 10 11 12 |
using NM; static int main (string[] args) { var client = new NM.Client(); var devices = client.get_devices (); for (uint i = 0; i < devices.length; i++) { message ("%s", devices.get(i).driver); } return 0; } |
Bug reports and patches are more than welcome! Please, give the bindings a try as well, they could use some real world testing.
The latest tarballs already include them, I expect them to land in Ubuntu Quantal soon, make sure to file bugs against OpenSUSE and Fedora and other distros if the packages are not deploying the bindings yet.
I would like to thank Jens Georg (phako), Juerg Billeter (juergbi) and Dan Williams (dcbw) for the help debugging issues, reviewing patches and other guidance.
Happy hacking!