Add in a setable path for themes
authorBrett Parker <arch@sommitrealweird.co.uk>
Sat, 13 May 2006 09:57:35 +0000 (09:57 +0000)
committerBrett Parker <arch@sommitrealweird.co.uk>
Sat, 13 May 2006 09:57:35 +0000 (09:57 +0000)
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
bpgallery.sh

diff --git a/README b/README
index 0825950c22e432e35b11b0e53ecc32e0c50b7d79..6b9f99d2c3339c3d95140e03c94b88ef03187d7b 100644 (file)
--- 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 <pre> block
 
 Example Usage:
index 8c186bb2f1ed04038b20839cc96d1dd6c5eedf1f..165048558e00d169dae5d696b31d98eea902061c 100755 (executable)
@@ -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