@ MackenziehThis method cannot be used (if you wanted, you must edit the pluginrc file).
The menu is grayed out only when no image is open.
This does not replace the original location in the Filters/G'mic-Qt menu, it just adds a new item on the top bar (typical "shortcut").
Until recently (before
Ofnuts tips) I didn't notice that there are two ways to register: "old" which will not work in the future Gimp-3.0 and recommended "new" (menu-register as a separate entry).
For convenience revised python and script-fu (for today's and future versions of Gimp) in the attachment.
You should decide - what to choose: script-fu (*.scm) or Python plugin (*.py).
Python code:
#!/usr/bin/env python
#-*- coding: utf-8 -*-
# based on the idea "Gimpscripter" https://github.com/bootchk/gimpscripter
from gimpfu import *
def python_fu_faves_gmic_qt(image, drawable):
pdb.plug_in_gmic_qt( image, drawable, 0, 0, 0, run_mode=RUN_INTERACTIVE)
register(
"python_fu_faves_gmic_qt",
"Shortcut to favourite plugins",
"This plugin was created using 'GimpScripter...",
"Bootchk - modified MareroQ",
"GPL",
"2020",
"G'MIC QT..",
"RGB*, GRAY*",
[
(PF_IMAGE, "image", "Input image", None),
(PF_DRAWABLE, "drawable", "Input drawable", None),
],
[],
python_fu_faves_gmic_qt, menu="<Image>/G'MIC"
)
main()
Script-fu code:
(define (script-fu-gmic-faves-location image drawable)
(plug-in-gmic-qt 0 image drawable 1 1 "")
)
(script-fu-register "script-fu-gmic-faves-location"
"G'MIC-Qt..."
"Shortcut to call G'MIC from Gimp main menu"
"MrQ"
"GPL"
"2020"
"RGB*, GRAY*"
SF-IMAGE "Image" 0
SF-DRAWABLE "Drawable" 0
)
(script-fu-menu-register "script-fu-gmic-faves-location" "<Image>/G'MIC")