It is currently Thu Sep 24, 2026 9:46 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 15 posts ] 
Author Message
 Post subject: Is there a way to create you own menu heading with favourite things
PostPosted: Sat Jun 21, 2014 6:37 am  (#1) 
Offline
GimpChat Member

Joined: Nov 14, 2013
Posts: 101
GIMP Version: 2.8.10
Operating System: Linux
GIMP Experience: Beginner Level



Say create a heading MyFavFilters and put your favourites under there instead of having to dig through the various menus?
Is there some file I can edit?

_________________
using Gimp 2.10.8 with Linux on an ancient laptop


Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: Is there a way to create you own menu heading with favourite thing
PostPosted: Sat Jun 21, 2014 6:58 am  (#2) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14835
Location: roma, italy
for .scm scripts and .py scripts it's quite easy:
- edit your script with a text editor like notepad++ for instance
- change the menu entry you find in one you better prefer
(this is one of my menu entries, as an example:
menu='<Image>/Addons/AddPY/Render/Fill grid with random color/')
- close, reopen gimp
you will find your filter where you said

_________________
"Where am I ?"


Top
 Post subject: Re: Is there a way to create you own menu heading with favourite thing
PostPosted: Sat Jun 21, 2014 8:17 am  (#3) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4812
A method that works with all, is to create a short script that calls your favorite one and registers it wherever you want. You can have one single script to relocate all your scripts/plugins (scheme, python or C/C++). This also doesn't require to re-edit the script/plugin each time you download a new version.

But IMHO, the ones you use really often should be assigned to keyboard shortcuts, and don't forget Ctrl-F & Ctrl-Shift-F to re-execute the last filter (with same or new parameters).

_________________
Image


Top
 Post subject: Re: Is there a way to create you own menu heading with favourite thing
PostPosted: Sat Jun 21, 2014 8:26 am  (#4) 
Offline
GimpChat Member

Joined: Nov 14, 2013
Posts: 101
dinasset wrote:
for .scm scripts and .py scripts it's quite easy:
- edit your script with a text editor like notepad++ for instance
- change the menu entry you find in one you better prefer
(this is one of my menu entries, as an example:
menu='<Image>/Addons/AddPY/Render/Fill grid with random color/')
- close, reopen gimp
you will find your filter where you said

@ Dinasset - I already do that with scripts I have downloaded.
@ Ofnuts Yes I have assigned a few keyboard shortcuts.

_________________
using Gimp 2.10.8 with Linux on an ancient laptop


Last edited by Born2BeMild on Sat Jun 21, 2014 9:25 am, edited 1 time in total.

Top
 Post subject: Re: Is there a way to create you own menu heading with favourite thing
PostPosted: Sat Jun 21, 2014 8:29 am  (#5) 
Offline
GimpChat Member
User avatar

Joined: Apr 07, 2010
Posts: 14182
Do you mean ofnuts?

_________________
Image


Top
 Post subject: Re: Is there a way to create you own menu heading with favourite thing
PostPosted: Sat Jun 21, 2014 9:26 am  (#6) 
Offline
GimpChat Member

Joined: Nov 14, 2013
Posts: 101
@molly i only meant ofnuts for the second comment - I have edited my post

_________________
using Gimp 2.10.8 with Linux on an ancient laptop


Top
 Post subject: Re: Is there a way to create you own menu heading with favourite thing
PostPosted: Sat Jun 21, 2014 11:04 am  (#7) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14835
Location: roma, italy
ofnuts wrote:
A method that works with all, is to create a short script that calls your favorite one and registers it wherever you want. You can have one single script to relocate all your scripts/plugins (scheme, python or C/C++). This also doesn't require to re-edit the script/plugin each time you download a new version.
...
.

Wow, it's fantastic!
But in my ignorance about that, I ask you Ofnuts: how does it look like such a script?
Could you post a simple example: a script which calls just one other script and changes its registration menu, for instance under "my preferred filters"?

_________________
"Where am I ?"


Top
 Post subject: Re: Is there a way to create you own menu heading with favourite thing
PostPosted: Sat Jun 21, 2014 4:37 pm  (#8) 
Offline
Script Coder
User avatar

Joined: Jun 22, 2010
Posts: 1171
Location: Here and there
dinasset wrote:
Wow, it's fantastic!
But in my ignorance about that, I ask you Ofnuts: how does it look like such a script?
Could you post a simple example: a script which calls just one other script and changes its registration menu, for instance under "my preferred filters"?


Here's how I suggested doing this: viewtopic.php?f=4&t=9942&p=129925&hilit=register#p129925

Kevin


Top
 Post subject: Re: Is there a way to create you own menu heading with favourite thing
PostPosted: Sat Jun 21, 2014 11:34 pm  (#9) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14835
Location: roma, italy
paynekj wrote:
dinasset wrote:
Wow, it's fantastic!
But in my ignorance about that, I ask you Ofnuts: how does it look like such a script?
Could you post a simple example: a script which calls just one other script and changes its registration menu, for instance under "my preferred filters"?


Here's how I suggested doing this: http://gimpchat.com/viewtopic.php?f=4&t ... er#p129925

Kevin

Thanks a lot, Kevin!
I forgot that extremely useful posting.
Can it be used for ANY kind of filter (scheme - python - exe) as Ofnuts says?

_________________
"Where am I ?"


Top
 Post subject: Re: Is there a way to create you own menu heading with favourite thing
PostPosted: Sun Jun 22, 2014 6:15 am  (#10) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14835
Location: roma, italy
just another (silly) question, KP:
- the sample you provided in the referenced post should have itself a "registration"? or just putting those lines (with adjusted filters names) as an zzz.scm at the end of the opened scripts is enough? question obsolete

edit: re-reading that post it seems that it is enough to put it as the last .scm so it is

2.nd edit: applied KP suggestion, it works perfectly; very easy to do that way

3.rd edit: a little warning to those who like to try the same: the original script MUST have the menu registration defined in a separate line, like script-fu-menu-register ...(new style), NOT as a line embedded in the script registration (old style)

_________________
"Where am I ?"


Top
 Post subject: Re: Is there a way to create you own menu heading with favourite thing
PostPosted: Thu Feb 05, 2015 10:16 am  (#11) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14835
Location: roma, italy
ofnuts wrote:
A method that works with all, is to create a short script that calls your favorite one and registers it wherever you want. You can have one single script to relocate all your scripts/plugins (scheme, python or C/C++). This also doesn't require to re-edit the script/plugin each time you download a new version.
...

Old question, which today enters again the game.
I used in the past (and also today) this technique to "move" a script-fu from one menu to another one
My specific question is:
- what to specify in a line referring to a compiled C filter?
not being a "script-fu" I tried to enter the command which is used in the C code, that is:
(gimp-plugin-menu-register... ) instead of (script-fu-menu-register... )
but it's not accepted, neither if entered with underscores (as in C code) nor if entered with dashes
last attempt: (gimp-plugin-menu-register "plug-in-liquify" "<Image>/BestFilters/Distorts")
tried also with additional parenthesys:
(gimp-plugin-menu-register ("plug-in-liquify" "<Image>/BestFilters/Distorts"))

it still tries to find the entry in script-fu-menu-register and doesn't find it
For someone who can make the correct line statement work, the plug-in I'd like to move is
liquify ("plug-in-liquify"), as in the attempt shown
note: the command with a script-fu filter works fine (provided it has been defined with a specific separated menu-register command)

_________________
"Where am I ?"


Top
 Post subject: Re: Is there a way to create you own menu heading with favourite thing
PostPosted: Thu Feb 05, 2015 11:17 am  (#12) 
Offline
Script Coder
User avatar

Joined: Jun 22, 2010
Posts: 1171
Location: Here and there
If you investigate the GIMP source code, you find that gimp-plugin-menu-register is only allowed to be called by the plug-in itself, no-one else is allowed to call it.

What ofnuts suggested is to write a script-fu/python wrapper round a call to the plug-in, then you can register the script-fu/python anywhere you want to.

(define (script-fu-cartoon image drawable)
  (plug-in-cartoon RUN-INTERACTIVE image drawable 0 0)
)

(script-fu-register "script-fu-cartoon"
                    "Cartoon"
                    "calls cartoon"
                    "2015"
                    "I did this"
                    "version 1"
                    ""
                    SF-IMAGE "Input Image" 0
                    SF-DRAWABLE "Input Drawable" 0
                    )

(script-fu-menu-register "script-fu-cartoon" "<Image>/Script-Fu/Kevin")


Top
 Post subject: Re: Is there a way to create you own menu heading with favourite thing
PostPosted: Thu Feb 05, 2015 11:33 am  (#13) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14835
Location: roma, italy
Oh, I see! A wrapper...
Now it's clear.
Thanks Kevin, I tought it could be possible to use your technique...(not only for script-fu I mean)

(for the moment, I'm not oriented to use a wrapper; once you have that for each filter you will have two entries; the original entry under the original menu and the wrapper entry under the wrapper menu)

_________________
"Where am I ?"


Top
 Post subject: Re: Is there a way to create you own menu heading with favourite thing
PostPosted: Thu Feb 05, 2015 11:37 am  (#14) 
Offline
Global Moderator
User avatar

Joined: May 16, 2010
Posts: 16174
You could just change the pluginrc file menu entry.

(plug-in-def "C:\\Users\\Rod\\.gimp-2.8\\plug-ins\\liquify.exe" 1422921527
    (proc-def "plug-in-liquify" 1
         "Use mouse control to warp image areas"
         "Interactive warping of the specified drawable"
         "Norbert Schmitz"
         "Norbert Schmitz"
         "1997"
         "_Liquify..."
         1
        (menu-path "<Image>/Filters/Distorts")
        (icon stock-id -1 "")
         "RGB*, GRAY*"
         3 0
        (proc-arg 0 "run-mode" "Interactive, non-interactive")
        (proc-arg 13 "image" "Input image (unused)")
        (proc-arg 16 "drawable" "Input drawable")))


Top
 Post subject: Re: Is there a way to create you own menu heading with favourite thing
PostPosted: Thu Feb 05, 2015 12:51 pm  (#15) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14835
Location: roma, italy
Yes Rod, it has been my preferred solution so far.
I was just looking at the possibility to have a "menu-changer" script like for the script-fus, but I will stay with the pluginrc solution.
Thanks

_________________
"Where am I ?"


Top
Post new topic Reply to topic  [ 15 posts ] 

All times are UTC - 5 hours [ DST ]



* Login  



Powered by phpBB3 © phpBB Group