DBus
Inkscape has supported a DBus interface for some time.... but information on how to use it is lacking. It is also not clear how to use Gio::Actions which are suppose to work with DBus. This page is an investigation into using DBus with Inkscape.
It would be very useful if anyone who has experience with using the DBus interface add information here!
Simple Use
Verification that DBus actually still works (on Fedora):
- Compile with DBUS (cmake -DWITH_DBUS=ON path_to_source).
- Start Inkscape.
- Open an Emacs window.
- Type:
Put the cursor at the very end of the function (just after ')))') and type Ctrl-X Ctrl-E.(message "%s on board." (cond ((dbus-ping :session "org.inkscape" 100) "Inkscape") (t "No")))
- The Emacs 'Message" buffer should show "Inkscape on board" if you have successfully connected to the running Inkscape app.
Open a New Inkscape Window:
- Type:
Put the cursor at the very end of the function and type Ctrl-X Ctrl-E.(dbus-call-method :session "org.inkscape" "/org/inkscape/application" "org.inkscape.application" "desktop_new")
- The Emacs "Message" buffer should show "/org/inkscape/desktop_1" and a new window should have opened.
Add a rectangle:
- Type:
Put the cursor at the very end of the function and type Ctrl-X Ctrl-E.(dbus-call-method :session "org.inkscape" "/org/inkscape/desktop_1" "org.inkscape.document" "rectangle" :int32 100 :int32 100 :int32 100 :int32 100)
- A rectangle should appear in the new Inkscape drawing.
Notes
Command line arguments:
- --dbus-listen
- --dbus-name=BUS-NAME
- --display=DISPLAY
How to use these? At least the --dbus-name does not seem to work (bus name is always "org.inkscape").