[core/theme] add support for XDG_DATA_DIRS

read theme information from
$XDG_DATA_DIRS/bumblebee-status/themes

see #821
This commit is contained in:
tobi-wan-kenobi 2022-07-03 13:56:02 +02:00
parent f462102439
commit 326e2f9318

View file

@ -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():