diff options
author | Ben Boeckel <MathStuf@gmail.com> | 2010-10-02 16:19:18 -0400 |
---|---|---|
committer | Ben Boeckel <MathStuf@gmail.com> | 2010-10-02 16:24:14 -0400 |
commit | ee3e5ccc576041baeacf9ee3082d453e2fe74fb6 (patch) | |
tree | 17303488594abfec8bfb270da4e330ad89dc1194 /src/uzbl-browser | |
parent | 1d4b7c0763a89066faa717adea4d35e7a0ad8458 (diff) |
Use the global configuration as a fallback
First check if there isn't a global config. If there isn't *then* we can
fail. If there is and the copy fails, at least run with the global
configuration.
Diffstat (limited to 'src/uzbl-browser')
-rwxr-xr-x | src/uzbl-browser | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/uzbl-browser b/src/uzbl-browser index de4f7af..fabefc4 100755 --- a/src/uzbl-browser +++ b/src/uzbl-browser @@ -40,10 +40,16 @@ 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 [ ! -r $PREFIX/share/uzbl/examples/config/config ] + then + echo "Error: Global config not found; please check if your distribution ships them separately" + exit 3 + fi if ! cp $PREFIX/share/uzbl/examples/config/config $XDG_CONFIG_HOME/uzbl/config then echo "Could not copy default config to $XDG_CONFIG_HOME/uzbl/config" >&2 - exit 3 + # Run with the global configs as a last resort + config="--config $PREFIX/share/uzbl/examples/config/config" fi fi @@ -63,4 +69,4 @@ DAEMON_PID=${DAEMON_SOCKET}.pid uzbl-event-manager -va start #fi -exec uzbl-core "$@" --connect-socket $DAEMON_SOCKET +exec uzbl-core "$@" $config --connect-socket $DAEMON_SOCKET |