feat: add system plugin dir

This commit is contained in:
0xMRTT 2022-09-15 18:49:43 +02:00
parent 12b525f11f
commit 8f279f6ccb
No known key found for this signature in database
GPG key ID: AC9E06BF3DECB6FB
2 changed files with 9 additions and 1 deletions

View file

@ -26,3 +26,5 @@ project_url = '@PROJECT_URL@'
bugtracker_url = '@BUGTRACKER_URL@'
help_url = '@HELP_URL@'
translate_url = '@TRANSLATE_URL@'
pkgdatadir = '@PKGDATA_DIR@'
localedir = '@LOCALE_DIR@'

View file

@ -21,7 +21,8 @@ import os
from gi.repository import Adw, GLib
from yapsy.PluginManager import PluginManager
from .plugin_row import GradiencePluginRow
from .constants import pkgdatadir
from .modules.utils import buglog
USER_PLUGIN_DIR = os.path.join(
os.environ.get("XDG_DATA_HOME", os.environ["HOME"] + "/.local/share"),
@ -29,6 +30,10 @@ USER_PLUGIN_DIR = os.path.join(
"plugins",
)
SYSTEM_PLUGIN_DIR = os.path.join(
pkgdatadir,
"plugins",
)
class GradiencePluginsList:
"""Represent the plugin group in Advanced"""
@ -52,6 +57,7 @@ class GradiencePluginsList:
self.pm.setPluginPlaces(
[
USER_PLUGIN_DIR,
SYSTEM_PLUGIN_DIR
]
)
self.pm.collectPlugins()