From e096dcb23b4c332ddf63b8253852af135de51949 Mon Sep 17 00:00:00 2001 From: Huevos Date: Thu, 19 Mar 2026 09:42:12 +0100 Subject: [PATCH] [skin] Check for skin related xml additions provided by third parties, such as plugins. Check for these in /etc/enigma2//*.xml. Files should have clear, unique names like plugin_xyz_skin.xml. --- lib/python/skin.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/python/skin.py b/lib/python/skin.py index 95c8b22ce38..8464f69cf34 100644 --- a/lib/python/skin.py +++ b/lib/python/skin.py @@ -2,13 +2,14 @@ import xml.etree.ElementTree from enigma import addFont, eLabel, ePixmap, ePoint, eRect, eSize, eWidget, eWindow, eWindowStyleManager, eWindowStyleSkinned, getDesktop, gFont, getFontFaces, gRGB, BT_ALPHATEST, BT_ALPHABLEND, BT_HALIGN_CENTER, BT_HALIGN_LEFT, BT_HALIGN_RIGHT, BT_KEEP_ASPECT_RATIO, BT_SCALE, BT_VALIGN_BOTTOM, BT_VALIGN_CENTER, BT_VALIGN_TOP -from os.path import basename, dirname, isfile +from os.path import basename, dirname, isdir, isfile, join +from os import listdir from Components.config import ConfigSubsection, ConfigText, config from Components.RcModel import rc_model from Components.Sources.Source import ObsoleteSource from Components.SystemInfo import BoxInfo -from Tools.Directories import SCOPE_CURRENT_LCDSKIN, SCOPE_CURRENT_SKIN, SCOPE_FONTS, SCOPE_SKIN, resolveFilename +from Tools.Directories import SCOPE_CURRENT_LCDSKIN, SCOPE_CONFIG, SCOPE_CURRENT_SKIN, SCOPE_FONTS, SCOPE_SKIN, resolveFilename from Tools.Import import my_import from Tools.LoadPixmap import LoadPixmap @@ -99,6 +100,14 @@ def InitSkins(): break print("[Skin] Error: Adding %s GUI skin '%s' has failed!" % (name, config.skin.primary_skin.value)) result.append(skin) + # Check for skin related xml additions provided by third parties, such as plugins. + # Check for these in /etc/enigma2//*.xml. + # Files should have clear, unique names like plugin_xyz_skin.xml. + if isdir(userFolder := join(resolveFilename(SCOPE_CONFIG), dirname(config.skin.primary_skin.value))): + for file in listdir(userFolder): + if file.lower().endswith(".xml"): + loadSkin(join(dirname(config.skin.primary_skin.value), file), scope=SCOPE_CONFIG, desktop=getDesktop(GUI_SKIN_ID), screenID=GUI_SKIN_ID) + # Add an optional skin related user skin "user_skin_.xml". If there is # not a skin related user skin then try to add am optional generic user skin. result = None