Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loading custom plugins #1155

Closed
enricoar opened this issue May 15, 2019 · 5 comments · Fixed by #2422 · May be fixed by #3063
Closed

Loading custom plugins #1155

enricoar opened this issue May 15, 2019 · 5 comments · Fixed by #2422 · May be fixed by #3063
Assignees
Labels
Milestone

Comments

@enricoar
Copy link

Maybe it's already possible, but I didn't find out why. Is it possible to make own plugins and put them somewhere so they are recognized by xournalpp. At the moment it seems to work only if I put them in the plugin directory of the cloned source. It would be useful if one could put it, e.g. in the .xournalpp directory.
Thanks

@Technius Technius self-assigned this May 4, 2020
@Technius Technius added this to the v1.1.0 milestone May 4, 2020
@Technius
Copy link
Member

Technius commented May 4, 2020

This can now be easily accomplished thanks to #1384.

Currently, the plan is to load plugins from all of the following paths:

  • $XDG_DATA_HOME/xournalpp/plugins. This will cover e.g. ~/.local/share/xournalpp/plugins.
  • $DIR/xournalpp/plugins where $DIR is a folder from $XDG_DATA_DIRS. This will cover e.g. /usr/share/xournalpp/plugins.
  • $CONFIG_FOLDER/plugins where $CONFIG_FOLDER is the xournalpp configuration folder, in case the configuration is synced across computers.

@Technius Technius changed the title Own plugins Loading custom plugins May 4, 2020
@Technius Technius added the plugins Related to plugin system label Nov 14, 2020
@Technius Technius removed their assignment Nov 14, 2020
@Febbe
Copy link
Collaborator

Febbe commented Nov 15, 2020

I would also add ./plugins and ../plugins and ../../plugins

@Febbe Febbe mentioned this issue Nov 15, 2020
30 tasks
@Febbe Febbe self-assigned this Nov 16, 2020
@Febbe
Copy link
Collaborator

Febbe commented Nov 16, 2020

What shall we do, if there are duplicates?
I propose to add the path to the PluginManager, so both plugins are closeable, but they must be mutually exclusive I think.

Febbe added a commit to Febbe/xournalpp that referenced this issue Nov 16, 2020
 - [ ] Make duplicates differentiable
 - [ ] Do not open all duplicates with the same name.

fixes xournalpp#1155
@Technius
Copy link
Member

I would also add ./plugins and ../plugins and ../../plugins

Do you mean relative to the xournalpp binary? If you instead mean relative to the current directory, I would see no reason for why this would be desirable.

What shall we do, if there are duplicates?

The most straightforward way I can think of is to load only the plugin that comes first in a priority list on the search paths (e.g. load the plugins from the user directories first, then ignore plugins with names similar to the ones already loaded in the following directories).

@Febbe
Copy link
Collaborator

Febbe commented Nov 16, 2020

Do you mean relative to the xournalpp binary? If you instead mean relative to the current directory, I would see no reason for why this would be desirable.

Yes relative to the source, this would make xournalpp relocatable.

The most straightforward way I can think of is to load only the plugin that comes first in a priority list on the search paths (e.g. load the plugins from the user directories first, then ignore plugins with names similar to the ones already loaded in the following directories).

Interestingly it seems to work very well to load plugins with the same name.
But in the case we only show and load it once, which search order shall we use?
My proposal would be similar to yours: XDG_CONFIG_DIR/xournalpp/plugins > xournalpp<.exe>/../plugin > xournalpp<.exe>/../../plugin > xournalpp<.exe>/../../../plugins > glade_search_path

Febbe added a commit to Febbe/xournalpp that referenced this issue Nov 16, 2020
 - [ ] Make duplicates differentiable
 - [ ] Do not open all duplicates with the same name.

fixes xournalpp#1155
Febbe added a commit to Febbe/xournalpp that referenced this issue Nov 17, 2020
 - [ ] Make duplicates differentiable
 - [ ] Do not open all duplicates with the same name.

fixes xournalpp#1155
@Technius Technius modified the milestones: v1.1.0, Future major version Jan 22, 2021
@Technius Technius linked a pull request Apr 26, 2021 that will close this issue
Febbe added a commit to Febbe/xournalpp that referenced this issue Nov 22, 2021
 - [ ] Make duplicates differentiable
 - [ ] Do not open all duplicates with the same name.

fixes xournalpp#1155
Febbe added a commit to Febbe/xournalpp that referenced this issue Nov 22, 2021
 - [ ] Make duplicates differentiable
 - [ ] Do not open all duplicates with the same name.

fixes xournalpp#1155
Febbe added a commit to Febbe/xournalpp that referenced this issue May 21, 2022
 - [ ] Make duplicates differentiable
 - [ ] Do not open all duplicates with the same name.

fixes xournalpp#1155
Febbe added a commit to Febbe/xournalpp that referenced this issue May 21, 2022
 - Made duplicates differentiable
 - Do not open all duplicates with the same name.

fixes xournalpp#1155
Febbe added a commit to Febbe/xournalpp that referenced this issue May 21, 2022
 - Made duplicates differentiable
 - Do not open all duplicates with the same name.

fixes xournalpp#1155
Febbe added a commit to Febbe/xournalpp that referenced this issue Jun 13, 2022
 - Made duplicates differentiable
 - Do not open all duplicates with the same name.

fixes xournalpp#1155
Febbe added a commit to Febbe/xournalpp that referenced this issue Jun 13, 2022
 - Made duplicates differentiable
 - Do not open all duplicates with the same name.

fixes xournalpp#1155
Febbe added a commit to Febbe/xournalpp that referenced this issue Jun 13, 2022
 - Made duplicates differentiable
 - Do not open all duplicates with the same name.

fixes xournalpp#1155
Febbe added a commit that referenced this issue Jun 13, 2022
 - Made duplicates differentiable
 - Do not open all duplicates with the same name.

fixes #1155
@Technius Technius modified the milestones: Future major version, v1.2.0 Dec 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants