pythonbashpluginsgimppython-fu

GIMP bash, add layer to existing GUI instance


  1. I'd like to communicate with the existing GUI instance of GIMP, with a plugin. I already have an another app and I want it to add a layer in the current existing GUI instance of GIMP. Is it possible? The scenario is: I open GIMP (GUI), then after some time, my program (in the system) add a layer to my current image I'm working with, without any manual processing in Gimp.

  2. If the first one is not possible, how to make GIMP plugin watch an url with a looping request. I tried with a plugin and it makes my GIMP GUI freeze


Solution

  • By default there is only one instance of Gimp running, so you can

    1. start Gimp, load one or more images in it
    2. in a bash prompt use something like:
    gimp --batch-interpreter python-fu-eval -b "print gimp.image_list()"
    

    Gotchas:

    For more complex code (ie, providing a python file) see this answer, but omit the -b "pdb.gimp_quit(1)" that will make Gimp exit.