Skip to content

Contents TOC

Clean up document

When you are working with large images, the file can get bloated and Inkscape can become very sluggish. This is solved by periodically doing File → Clean up document.

Create custom keyboard shortcuts

I often find myself repeating an action continuously. Doing this by clicking on menus and choosing the option gets annoying. You can set custom keyboard shortcuts by editing your ~/.config/inkscape/keys/default.xml. For example, I added the following lines to bind Ctrl + Alt + Shft + F to resize the document to objects or selection.

<bind
    key="F"
    modifiers="Ctrl,Alt,Shift"
    action="FitCanvasToSelectionOrDrawing" />

Convert SVG to PNG automatically

When I make presentation slides in Inkscape, I need to convert the .svg files to .png files for display using reveal.js. I do this automatically by:

  1. Install incrontab following instructions here. Note that you might have to add your username (in my case rasi) to the file /etc/incron.allow for incrontab to work.

  2. Save the following bash script at ~/.config/update_slides.sh.

    #!/home/rasi/bin/bash
    filepath=$1$2
    newname=${filepath//svg/png}
    echo $filepath $newname
    inkscape --export-png=$newname --export-dpi=144 $filepath
    
  3. Add the directory you are monitoring for file to your incrontab list. For this, first type incrontab -e. Then add the following line:

    /home/rasi/Dropbox/work/presentations/20180912_bpsd_talk/svg/ IN_MODIFY bash /home/rasi/.config/update_slides.sh $@ $#
    
  4. In the above case, I am monitoring the svg subfolder of my parent folder for changes and adding the new .png files to the png subfolder.

  5. Remember that you have to modify the monitored folder each time you start working on a presentation.