As part of the initial code for the Cloud4All project, we already have a GSettings bridge for to handle some desktop settings, but we needed a mechanism for to deal with other behaviours/settings of the GNOME Desktop, and DBus fits here.
The endline for this implementation isn’t too close, but we’re already making the Cloud4All stack better and I’ve just pushed a DBus module for Node.js.
At this moment, the functionalities are a little bit limited, but I can think in two working use cases:
- Enable/disable GNOME Shell Magnifier.
- Change GNOME Shell default behaviour and/or appearance by using extensions.
But there are a lot of applications running their DBus services and there are a lot of already demonstrable use cases.
I have this code into a personal branch in github and I’ve attached a test which does basically four things.
- Enable the magnifier
- Disable the magnifier
- Install a remote extension in GNOME Shell (you need to click on “Install”)
- Uninstall the extension
Now is a preliminary working code, it was my first time dealing with Node.js and needed to learn some about V8 and Node.js, so the code will change a bit in a few weeks. Next steps will be:
- [EDITED] Checkout https://github.com/creationix/node-gir and https://github.com/rossburton/node-dbus
- Test the code in many ways
- Create more use cases and code its respective tests
- Improve/Simplify the code
- Integrate the module into the Cloud4All/Linux repository
Soon, I’ll post more about Cloud4all, so stay tuned!
Do you know the node-gir project?
https://github.com/creationix/node-gir
Yes I do, but I found it after starting with the work
I didn’t tried it yet, so I’m guessing that I could give a try and if it works properly, port the current gsettings and dbus stuff into node-gir soon. :]
Cheers!
There are many DBus bindings for Node. One of the better that I’ve found is https://github.com/izaakschroeder/node-dbus, I’ve a fork at https://github.com/rossburton/node-dbus with some improvements. These use raw libdbus instead of GDBus.
These are pretty feature complete, the only missing feature from what I recall is writing async handlers for services exported to the bus.
Hey Ross, thanks for commenting!
At this moment I’m not completely sure about our future needs, but I’ll take this into account too.
Regards!
PS: I’ve just updated the post with these two suggestions