From 326e2f9318b0e4955a04d70b3dff463b0c3f33ad Mon Sep 17 00:00:00 2001 From: tobi-wan-kenobi Date: Sun, 3 Jul 2022 13:56:02 +0200 Subject: [PATCH] [core/theme] add support for XDG_DATA_DIRS read theme information from $XDG_DATA_DIRS/bumblebee-status/themes see #821 --- bumblebee_status/core/theme.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/bumblebee_status/core/theme.py b/bumblebee_status/core/theme.py index 4de58d3..d91b060 100644 --- a/bumblebee_status/core/theme.py +++ b/bumblebee_status/core/theme.py @@ -14,11 +14,19 @@ log = logging.getLogger(__name__) THEME_BASE_DIR = os.path.dirname(os.path.realpath(__file__)) PATHS = [ ".", - os.path.join(THEME_BASE_DIR, "../../themes"), + os.path.join(THEME_BASE_DIR, "../../themes") +] + +if os.environ.get("XDG_DATA_DIRS"): + PATHS.extend([ + os.path.join(p, "bumblebee-status/themes") for p in os.environ["XDG_DATA_DIRS"].split(":") + ]) + +PATHS.extend([ os.path.expanduser("~/.config/bumblebee-status/themes"), os.path.expanduser("~/.local/share/bumblebee-status/themes"), # PIP "/usr/share/bumblebee-status/themes", -] +]) def themes():