1

I would like to add the drop shadow filter to my toolbar for quick access.

0

2 Answers 2

3

Inkscape lets you overwrite many parts of its UI with special files in your config folder. However, it requires some technical know-how, is somewhat complicated and mostly undocumented, I think.

You will need to know the locations of some directories Inkscape looks in, so when I talk about the 'User config' folder for example, then check its path in the corresponding input box inside the preferences under 'System'.

First you need to find the name of the action that you want to make a button for. To do that, open the preferences, go to 'Interface → Command Palette' and enable the 'Show command line argument names' setting. You'll have to restart Inkscape for it to take effect. Now press ? to open the command-palette (depending on your keyboard layout, you may also need to hold Shift) and search for 'Drop Shadow'. There you should see a long reversed URL-like ID (you may have to scroll horizontally by holding Shift and using the scroll-wheel). You can click on it to copy it to the clipboard:

Command-palette with 'Drop Shadow' highlighted Action name button scrolled into view and highlighted

In your case it should be app.org.inkscape.effect.filter.ColorDropShadow.

Next, you need the original '.ui' files from the '/inkscape/ui' subdirectory inside the 'Inkscape data' folder. The one you want is probably toolbar-commands.ui. Copy this file over to the 'User UI' directory, keeping the name exactly the same. Depending on how you installed Inkscape (e.g. as an AppImage), you may need to keep Inkscape open to be able to access the 'Inkscape data' directory and its location may change whenever you restart Inkscape.

Now open the copied file in a text-editor (preferably one with XML syntax-highlighting). Scroll all the way down to the end. Here you can append new elements to the toolbar, by adding <child>-nodes before the </object></interface> closing-tags.

For a separator line for example simply copy and paste this from earlier in the file:

<child>
  <object class="GtkSeparatorToolItem">
    <property name="visible">True</property>
  </object>
</child>

To add a new button, insert this, but replace [ACTION-NAME] with the ID we wrote down earlier:

<child>
  <object class="GtkToolButton">
    <property name="action_name">[ACTION-NAME]</property>
    <property name="icon_name">inkscape-logo</property>
  </object>
</child>

You may notice that the other entries in that file have more properties, but they don't seem to be really needed, so I simplified it a bit.

You can change the icon by looking for one inside the '/inkscape/icons/hicolor/symbolic/actions' subdirectory in the 'Inkscape data' folder, copying the filename and inserting it as the icon name (replacing inkscape-logo above) without the '.svg' file extension (or '-symbolic' suffix). Also, it seems some actions (mostly extensions) can be called without opening its dialog by appending .noprefs to the ID.

Finally, save the file, restart Inkscape and your toolbar should now be customized:

Newly added 'Drop Shadow' button now appearing in the toolbar.

Please note that this will overwrite any new buttons added to the toolbar in future versions of Inkscape or all other changes to that part of the UI when you upgrade. This could mean that, at best you could miss new functionality or at worst completely break Inkscape's UI. I recommend deleting the custom '.ui' file and repeating this process whenever you install a new version!

1

It's not possible to add a filter to the Tool bar. It's not a "tool". Filters are SVG effects that are added to objects.

You can however open the Filter Editor (Filters > Filter Editor), and once you have applied an effect to an object, you can create or select another object and apply the same filter simply by ticking it in the Filter Editor.

For example, here I apply the same filter by just ticking it again

enter image description here

You can also click, drag and drop the Filter Editor tab (shown above) to dock it to the panels on the right hand side.

enter image description here

3
  • So I can save multiple presets? This is even better. Jun 10, 2023 at 11:03
  • 1
    @Gugalcrom123 The list only includes the filters in the current document, however you can set the default template to add some common filters to all new documents.
    – Xrott
    Jun 10, 2023 at 11:23
  • Well yes, but only the actual filters you have used in the document will be saved in the document. It won't keep them available for all documents. The suggestion by @Xrott to set up such a document as the default template is certainly one way to save them for future use.
    – Billy Kerr
    Jun 10, 2023 at 11:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.