aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/uzbl-browser
diff options
context:
space:
mode:
Diffstat (limited to 'src/uzbl-browser')
-rwxr-xr-xsrc/uzbl-browser22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/uzbl-browser b/src/uzbl-browser
index 9756ed1..88d3742 100755
--- a/src/uzbl-browser
+++ b/src/uzbl-browser
@@ -8,6 +8,7 @@
# to your $XDG_DATA_HOME/uzbl/scripts/ and edit them
PREFIX=/usr/local
+EXAMPLES=$PREFIX/share/uzbl/examples
XDG_DATA_HOME=${XDG_DATA_HOME:-$HOME/.local/share}
export XDG_DATA_HOME
@@ -34,20 +35,33 @@ done
# if no config exists yet in the recommended location, put the default (recommended) config there
if [ ! -f "$XDG_CONFIG_HOME"/uzbl/config ]
then
- global_config=$PREFIX/share/uzbl/examples/config/config
- if [ ! -r "$global_config" ]
+ if [ ! -r "$EXAMPLES"/config/config ]
then
echo "Error: Global config not found; please check if your distribution ships them separately"
exit 3
fi
- if ! cp "$global_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
# Run with the global config as a last resort
- config_file=$global_config
+ config_file=$EXAMPLES/config/config
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
+
# uzbl-cookie-manager will exit if another instance is already running.
# we could also check if its pid file exists to avoid having to spawn it.
#if [ ! -f "$XDG_CACHE_HOME"/uzbl/cookie_daemon_socket.pid ]