I would like to reload a document when the SVG file changes, because I'm working on it both with Inkscape and with another program. Is it possible to achieve this?
I know that I can run the `FileRevert` verb to reload a file (File>Revert), but I'd like to automatize the process: way too often I forget to revert and when I do, I end up losing the modifications made with the other program.
I tried to use inkscape's dbus interface to run the FileRevert verb from inotifywait when the file changes, but the interface is limited and broken: it doesn't support multiple inkscapes running at the same time, and I segfaulted inkscape a few times with it.
Are there other ways to automatize reloading the document when the file changes?
In case you're curious why I need this, keep reading...
I'm trying to use inkscape as a level editor for a video game: the levels are SVG files that should contain all the graphics, geometry and metadata.
Inkscape does a wonderful job with graphics and geometry, but it's not enough on the metadata side: I need to set custom elements and attributes to specify what is what and what it does. Manipulating these with inkscape's XML Editor is quite uncomfortable and so are the extensions I tried to write to help me. Eventually I decided to create a second editor that lets me add the metadata I need. The idea is that I draw shapes and graphics with inkscape, then switch to my other editor to add metadata, then back to inkscape to draw further, and so on. Both working on the same file. My editor reloads the document when it changes, but Inkscape doesn't.
If you can think of better ways to achieve what I need, I'm eager to learn.
I would like to reload a document when the SVG file changes, because I'm working on it both with Inkscape and with another program. Is it possible to achieve this?
I know that I can run the `FileRevert` verb to reload a file (File>Revert), but I'd like to automatize the process: way too often I forget to revert and when I do, I end up losing the modifications made with the other program.
I tried to use inkscape's dbus interface to run the FileRevert verb from inotifywait when the file changes, but the interface is limited and broken: it doesn't support multiple inkscapes running at the same time, and I segfaulted inkscape a few times with it.
Are there other ways to automatize reloading the document when the file changes?
In case you're curious why I need this, keep reading...
I'm trying to use inkscape as a level editor for a video game: the levels are SVG files that should contain all the graphics, geometry and metadata.
Inkscape does a wonderful job with graphics and geometry, but it's not enough on the metadata side: I need to set custom elements and attributes to specify what is what and what it does. Manipulating these with inkscape's XML Editor is quite uncomfortable and so are the extensions I tried to write to help me. Eventually I decided to create a second editor that lets me add the metadata I need. The idea is that I draw shapes and graphics with inkscape, then switch to my other editor to add metadata, then back to inkscape to draw further, and so on. Both working on the same file. My editor reloads the document when it changes, but Inkscape doesn't.
If you can think of better ways to achieve what I need, I'm eager to learn.