Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Gimp plugins folder ? locked
#1
I have a new install of Gimp 2.10 on a VMware Ubunto 18 on a MacBookPro.

I'm starting to learn python-Fu and for some reason can't copy my *.py script to the Gimp plugins folder. I'm a real new to Linux and have no idea why this is. The permissions for the plugin folder are read & write (Parent = root)

Any ideas why this would be?

Also , do you have any suggestions for tutorials, learning materials for creating scripts.  I've been a photoshop user for many years but now want to use gimp and specifically replace photoshop's 'automate' macro recorder with gimp scripts

With many thanks
Reply
#2
It has been many-many years since I last used VMware having moved on to VirtualBox in linux installations so...A couple of questions.

Are you writing the python scripts in your Mac then importing (somehow) into the ubuntu VM? There could well be 'owner' issues.

A 'buntu VM is just the same as a physical installation, with the OS and application files in 'root' but there will be a 'User' folder (sometimes separate partition) That is where the Gimp "user" resources are held.

It is a hidden folder (1) starts with a dot ~/.config/GIMP/2.10/plug-ins (2) (~ is linux shorthand for 'home') You will need to make hidden folders visible from the file manager.

[Image: 5e95Lwa.jpg]

Then in the plugins folder, your python script has to be executable, again use the file manager (1) and check the permissions and 'ownership' (2) , not sure how VMware handles this but can also be changed in the file manager.

[Image: cNJO4Ih.jpg]

Advice on learning to create scripts, others will have good advice.
Reply
#3
Many thanks Rich for the quick response.  The test scripts are written in Sublime text on the Ubuntu box.  I do have my test scripts in the ~/.config/GIMP/2.10/plug-ins folder but none appear in gimp where they are meant to show up.  I've checked the line:       extreme_unsharp_desaturation_tute, menu="<Filter>/Enhance")   it looks correct.

Do you happen to have a test (even blank) *.py script that I can test my system with?

Also do the *.py scripts have to be made executable?  I've tried both ways,   --- sorry I've just checked your response again and I do not have the dialogue to make the plugins folder executable, but all the contained *.pys  are.

Cheers
Reply
#4
Attached about the simplest I can find.

unzip, then pop in plug-ins folder. Permissions should already be set, but check anyway.

Find it in the 'Tools' Menu.

Just a thought, There is a new 'development version' from the gimp-edge 'buntu ppa that is horribly broken.

Check bottom of the Filters menu that there is a 'Python-Fu' entry. No entry, no python, plug-ins will not work.


Attached Files
.zip   resize-two-thirds.py.zip (Size: 519 bytes / Downloads: 250)
Reply
#5
Thanks again Rich,

I've just edited my post above.  You were so quick with your response.

Yes Python-Fu and Script-FU entrys are there on the Filters menu.

I'll install your script and give it a go.

Just tried - no work:

I have Gimp 2.10.4 and it has 'tools' 'Image' and 'filters' menu options  but your script doesn't appear in any.
Reply
#6
On Unix systerms (OSX and Linux), the python plugins have to be marked executable (chmod +x {file}).

In Gimp: Edit>Preferences>Folders>Plugins lists two directories: one is in the system files (/usr/lib/gimp/... on Linux) and one is in your user data. The first one is of course R/O to mere users, and you normally use the one in your own user directories.

Personally, I have used that same Edit>Preferences>Folders>Plugins to add two Active directories which are in the directories I use to write code. When I want to add a new script to Gimp, I just add a link to it in one of the two Active directories. This makes it easy to enable/disable scripts without moving them (because they have to stay with their doc, test files, etc...)

See you soon in https://www.gimp-forum.net/Forum-Scripting-questions Smile
Reply
#7
@Alan Lacey

Quote:..I have Gimp 2.10.4 and it has 'tools' 'Image' and 'filters' menu options but your script doesn't appear in any...

Before you blast away writing python plugins, better get Gimp 2.10.4 sorted first Wink

All the screen shots are in 'buntu 18.04 VM - just the KDE desktop version.

It looks to me that the default Gimp is still 2.8.x and to get a Gimp 2.10.4 you need to use a ppa

This one: https://launchpad.net/~otto-kesselgulasc...buntu/gimp

I normally use the VM for testing the Gimp-edge version but using the above gets me a Gimp 2.10.4 and working plugins

[Image: ulCVt3t.jpg]

Are you using some other Gimp 2.10.4 installation, an appimage or maybe the flatpak?
Reply
#8
Thank you both.

Well Rich I've just started up my ubuntu and Gimp again and miraculously your 2/3 image script is now there available and working!  I guess I not only needed to restart Gimp, but Ubuntu as well.  It's still the only one available in Gimp though, despite my few test scripts, but that's definitely a result.  All I need to do now is start scripting properly.

Ofnuts:  I'm very new to Linux, with the goal of being Microsoft and Apple Free by 2020, which is when MS stop supporting Win7.  So I don't yet understand how you would set up the two folders as you describe.  It does sound a good idea though, and I've made a note of it, so when I'm a little more proficient in Linux I'll be using your method.  There's still so much to learn.

Once again many thanks to both of you and now I need to delve into just why my scripts aren't there

Hmmm!  Not so fast sadly.

Rich I started by a simple modification to your 2/3 script, by just changing the parameters to 4/3 and all relevant entries.  Saved it alongside yours in the user plug-in folder, made sure it was executable.  And then NADA,  even after a Ubuntu restart. Weird or what?



!/usr/bin/python
# -*- coding: utf-8 -*-

from gimpfu import *

def plugin_four_thirds(timg, tdrawable):
    currentWidth = tdrawable.width
    currentHeight = tdrawable.height

    newWidth = currentWidth*3/2
    newHeight = currentHeight*3/2

    pdb.gimp_context_set_interpolation(2)
    pdb.gimp_image_scale(timg, newWidth, newHeight)
    pdb.plug_in_sharpen( timg, tdrawable, 60)
#    pdb.plug_in_wavelet_sharpen( timg, tdrawable, 2.0, 0.5, 0)

register(
        "python_fu_resize",
        "resize 4-3rds",
        "for imgur or BB",
        "*",
        "*",
        "2016",
        "<Image>/Tools/Resize 4-thirds...",
        "*",
        [],
        [],
        plugin_four_thirds)

main()


OKAY - got it It's the first register line needs to be renamed.  -  Onwards and upwards.
Reply
#9
@Alan Lacey

Pay no heed to me, I stopped with M$ DOS & PowerBasic Wink Ofnuts is a Pro.

To add folders in Gimp (any resource) Edit -> Preferences -> Folders -> Plug-ins

This my regular linux and a Gimp 2.10.4 flatpak. Even ~/.config/GIMP/2.10/plug-ins can be a pain to navigate to.

So as an example, a set of folders, easier to get at, in my home partition.

[Image: GzP6hql.jpg]
Reply
#10
I see, many thanks again.  I know I have so much to learn but at the same time I'm sure it'll be worth it as time invested.  Navigation and the terminal are at the top of my list once I've got the basics of Gimp scripting working.
Reply


Forum Jump: