From 45211626bfa6edab803ddb4a80a29c1fa2890c34 Mon Sep 17 00:00:00 2001 From: Brett Parker Date: Sat, 13 May 2006 09:57:35 +0000 Subject: [PATCH] Add in a setable path for themes Add in extra environmental variable to specify extra location to look for themes git-archimport-id: arch@sommitrealweird.co.uk--2005-desktop/bpgallery--mainline--1.0--patch-19 --- README | 1 + bpgallery.sh | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README b/README index 0825950..6b9f99d 100644 --- a/README +++ b/README @@ -30,6 +30,7 @@ The following environment variables can also be used: TITLE - the title of the gallery WIDTH - the width to make the icons BPGALLERY_THEME - set the theme to use (described below) + BPGALLERY_THEME_DIR - set an extra location to look for themes OUTPUTHTML - sets the script output to be wrapped in a
 block
 
 Example Usage:
diff --git a/bpgallery.sh b/bpgallery.sh
index 8c186bb..1650485 100755
--- a/bpgallery.sh
+++ b/bpgallery.sh
@@ -150,7 +150,10 @@ if [[ -z ${BPGALLERY_THEME} ]]; then
 	BPGALLERY_THEME=default
 fi
 
-if [[ -e $HOME/.bpgallery.themes/${BPGALLERY_THEME} ]]; then
+if [[ ! -z ${BPGALLERY_THEME_DIR} ]] && \
+	[[ -e ${BPGALLERY_THEME_DIR}/${BPGALLERY_THEME} ]]; then
+	. ${BPGALLERY_THEME_DIR/${BPGALLERY_THEME} 2>/dev/null
+elif [[ -e $HOME/.bpgallery.themes/${BPGALLERY_THEME} ]]; then
 	. $HOME/.bpgallery.themes/${BPGALLERY_THEME} 2>/dev/null
 elif [[ -e /usr/local/etc/bpgallery/themes/${BPGALLERY_THEME} ]]; then
 	. /usr/local/etc/bpgallery/themes/${BPGALLERY_THEME} 2>/dev/null
-- 
2.39.5