PATH for avogenerators with Linux AppImage

When I run the AppImage for Linux, Avogadro2 apparently does not load the input generators from the PATH:

~/.local/share/OpenChemistry/Avogadro/inputGenerators/avogenerators/

The input generator menu is complete, but it should be loaded from another location (or included in the binary somehow), as the changes I apply are not visible. Instead, when I install the package from source, my custom generators (in the aforementioned location) are loaded. Is there a way to use custom input generators running Avogadro2 from a Linux AppImage binary?

Thanks!

Javier

Yeah, they get included in the AppImage itself so presumably the provided ones are loaded preferentially to your edited ones.

As an AppImage isn’t actually a binary but rather a self-executing bundle of files, you could presumably extract the files of the AppImage, edit the generator files, then recreate the AppImage using AppImageKit.

To be honest, an alternative solution might be easier:

  1. You could build Avogadro yourself from source
  2. You could use the Flatpak, as it is easy to inspect the Flatpak’s contents and change them yourself
  3. You could change the name of the avogenerators plugin that is under ~/.local/share, take out all the files other than the ones you’ve made changes to, and change the names of the generators themselves (as in, change the display name that the scripts return when run), and then they should show up in addition to the provided ones

Hope that helps!

I think my question is whether the AppImage sets some environment variables that change the directory for “user local” plugin scripts.

In principle, if you’re running from the terminal, Avogadro should be printing the paths it checks for plugins. Does ~/.local show up when you run your AppImage?

Many thanks for the inputs, really valuable.

After some exploration, it seems that when a new AppImage is downloaded, the bundled input generators are used preferentially over those in ~/.local (a path that is known to the Avogadro2 AppImage). There are two ways to make Avogadro use the input scripts in my ~/.local path:

  1. Change the targetName in the python script (I think this is the alternative 3 proposed by @matterhorn103)
    This effectively adds an additional input generator to the menu list, so both versions appear: the one bundled in the AppImage and the modified one.
  2. Install plugins with ExtensionsDownlowad Pluginsavogenerators:
    This installs the scripts into ~/.local (overriding those previously there, so better have a copy!) and gives them priority over the versions bundled in the AppImage.

I ended up following option 2

Thanks again for the help!

Javier

Weird. That install step shouldn’t be necessary, and if there’s a copy in ~/.local for you, it should take precedence.

I’ll look into it as I rework the plugin loading code. It might have to do with the AppImage including pixi by default. I was coding up some paths primarily for Mac and Windows users, so I wouldn’t be surprised if there’s a corner case (i.e., yours) that I missed when laying out that logic.