gimpscript-fu

Is there a way to change the active tool assigned to a device using Script-Fu?


I want to create a toggle key to switch between two frequently used tools.

I thought I could switch the active tool using "gimp-context-set-paint-method," but it seems that this only changes the active tool within the script and does not modify the active tool assigned to the device.

Is it impossible to achieve this functionality with Script-Fu?


Solution

  • You can't change the UI through scripts. The API you mention is really the equivalent of the Paint tool drop-down in Edit > Stroke path and Edit > Stroke selection.

    But:

    1. There are already keyboard shortcuts assigned to most tools
    2. If really necessary you can assign your own using Edit > Keyboard shortcuts

    Granted, you can't have a single key that switches between two tools.