From: Brett Parker Date: Sat, 13 May 2006 09:57:35 +0000 (+0000) Subject: Add in a setable path for themes X-Git-Tag: release-1.0.3~3 X-Git-Url: https://git.sommitrealweird.co.uk/bpgallery.git/commitdiff_plain/45211626bfa6edab803ddb4a80a29c1fa2890c34?ds=sidebyside;hp=7ef6a62b83bf172619e03032828d59be3afc1bba 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 --- 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