From e660b9de3f4331ebf171735b40eb12105218b2d7 Mon Sep 17 00:00:00 2001 From: Brendan Taylor Date: Sun, 21 Nov 2010 23:15:02 -0700 Subject: set UZBL_UTIL_DIR in uzbl-browser, get rid of the scripts_util_dir variable --- src/uzbl-browser | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src/uzbl-browser') diff --git a/src/uzbl-browser b/src/uzbl-browser index de4f7af..865447c 100755 --- a/src/uzbl-browser +++ b/src/uzbl-browser @@ -10,6 +10,8 @@ # But this shouldn't cause much problems.. PREFIX=/usr/local +EXAMPLES=$PREFIX/share/uzbl/examples + if [ -z "$XDG_DATA_HOME" ] then export XDG_DATA_HOME=$HOME/.local/share @@ -40,13 +42,27 @@ done # if no config exists yet in the recommended location, put the default (recommended) config there if [ ! -f $XDG_CONFIG_HOME/uzbl/config ] then - if ! cp $PREFIX/share/uzbl/examples/config/config $XDG_CONFIG_HOME/uzbl/config + if ! cp "$EXAMPLES"/config/config $XDG_CONFIG_HOME/uzbl/config then echo "Could not copy default config to $XDG_CONFIG_HOME/uzbl/config" >&2 exit 3 fi fi +# this variable is used by the default helper scripts as a location to +# load shared code from +if [ -z "$UZBL_UTIL_DIR" ] +then + if [ -d "$XDG_DATA_HOME"/uzbl/scripts/util ] + then + UZBL_UTIL_DIR=$XDG_DATA_HOME/uzbl/scripts/util + elif [ -d $EXAMPLES/data/scripts/util ] + then + UZBL_UTIL_DIR=$EXAMPLES/data/scripts/util + fi + export UZBL_UTIL_DIR +fi + # Uncomment this for a slight speedup at the expense of not having # stale cookie daemon sockets cleaned up. #if [ ! -S $XDG_CACHE_HOME/uzbl/cookie_daemon_socket ] -- cgit v1.2.3