I came back to this problem again (still on Natty); so I thought I'd post my results.
First, I started looking up if you can run Gnome applets from the command line, and in a separate window - turns out, this was a technique for debugging Python applets;
This is the script:
# sudo apt-get install python-gnomeapplet
import CORBA # must have import gnomeapplet before!
bcontrol = bonobo.activation.activate_from_id('OAFIID:Invest_Applet', 0, False)
win = bonobo.ui.Window("foo", "FOOOOO")
buiwid = bonobo.ui.widget_new_control_from_objref(bcontrol, win.get_ui_container().corba_objref())
win.connect("destroy", lambda x: sys.exit(0))
... and the extended script (with debug output, and a ton of messy comments) is in gtk_bonobo_applet_widget.py.
This is exactly what I wanted, and at first, I thought that it would be applicable to all applets - at least in Natty (and among them
stickynotes); but alas, no:
Now, Natty is a bit specific, because it is the last Gnome 2 Ubuntu - however, it also features (the first) Unity. As such:
- some applets are based on (or exposing a)
CORBA interface (in Python, via
gnomeapplet); those, like
brightness-applet, can use the above technique to be raised in their own window - and can be queried through
libbonobo2-bin tools (like
- other applets, like
stickynotes, have migrated toward GSettings/DBUS base (interface)
stickynotes migrated from
dbus shortly before Natty came out (in the revision Port to new libpanel-applet API); which is obvious by the replacement of the
PANEL_APPLET_BONOBO_FACTORY macro with
PANEL_APPLET_OUT_PROCESS_FACTORY. Arguably, if one checks out the last revision of
stickynotes based on
bonobo and builds it - one should also be able to use the above technique to instantiate the applet in a separate window, and run it from there, even without
I would have otherwise believed, that all applets (or rather, applet developing frameworks) should have the capability to run in a separate window like that - if not for any other reason, then to facilitate debugging of applets during development. And given that some applets have command line switches for running in a separate window (both the "beginner's guide" above, and also
invest-applet, feature such switches) - I hoped maybe
stickynotes features such command line arguments too; however, I did grep through its source files - and alas, I cannot find any mention of command line options.
But then, I wondered - why this migration? Well, it is because
bonobo is (or rather, has been) deprecated for a while now:
AppletsDbusMigration - GNOME Live!: (2009)
Gnome Panel drop the libbonobo dependency recently (see bug #572131).
gnome-devel-list mailing list - What will replace bonobo? (2009)
Dbus is not a direct replacement for bonobo.
There is no exact replacement of bonobo as such.
However, the main usecase of bonobo, which is embedding one application in another (say mine-sweeper in gnumeric, or (slighly more useful) a dia diagram in gnumeric) just is not used all that much.
gnome-components mailing list 'Re: What will replace bonobo?' (2005)
> About DBUS it's hard to say that it will be replacement some day.
> First problem is that it's not component system, just message passing API.
Trust me, there are definitely plans to implement an IDL compiler of
some sort to imitate CORBA-style RPC on top of D-BUS messages. It will
happen sooner or later.
Well, shucks - I myself think, the "embedding one application in another" was very useful in this case - to run (at least some) applets in Unity, with support for them removed
:) Of course, it was a more-less a "lucky" arrangement of desktop packages in Natty that allowed for that (given that it is still Gnome 2 and still has the
bonobo libraries) - obviously, later versions that are Gnome 3 based have
bonobo removed completely - and the above Python-script-instantiation-in-a-window technique will most definitely not work there
The final question is - could we similarly use a Python script, but with bindings for
dbus, to achieve something similar to the above
bonobo based script?
Closest I got to that, is with the script gtk_dbus_applet_widget.py, however, that script doesn't raise an applet in a window - and cannot even add an applet to the bar! The only thing it can do, is talk to the applet "factory" via
dbus, and instruct it to create an applet; but this applet remains simply as data somewhere on the filesystem (and it persists across reboots!), and never becomes instantiated as a Gnome widget... And given the comments above, I doubt something like that is currently (well, on Natty at least) possible with
In conclusion - I guess this, along with the
gnome-panel technique, exhausts the possibilities of frivolously running applets under Unity in Natty.