aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/uzbl-browser
diff options
context:
space:
mode:
Diffstat (limited to 'src/uzbl-browser')
-rwxr-xr-xsrc/uzbl-browser66
1 files changed, 66 insertions, 0 deletions
diff --git a/src/uzbl-browser b/src/uzbl-browser
new file mode 100755
index 0000000..d9b9752
--- /dev/null
+++ b/src/uzbl-browser
@@ -0,0 +1,66 @@
+#!/bin/sh
+# this script implements a more useful out-of-the-box "browsing experience".
+# it does so by combining uzbl-core with a set of "recommended" tools and practices.
+# see docs for more info
+# If you want to customize the behavior of the cookie-daemon or similar helper tools,
+# copy them to your $XDG_DATA_HOME/uzbl/scripts/, edit them and update $PATH
+
+# Also, we assume existence of fifo/socket == correctly functioning cookie_daemon/event_manager.
+# Checking correct functioning of the daemons here would be too complex here, and it's not implemented in uzbl-core either.
+# But this shouldn't cause much problems..
+
+PREFIX=/usr/local
+if [ -z "$XDG_DATA_HOME" ]
+then
+ export XDG_DATA_HOME=$HOME/.local/share
+fi
+
+if [ -z "$XDG_CACHE_HOME" ]
+then
+ export XDG_CACHE_HOME=$HOME/.cache
+fi
+
+if [ -z "$XDG_CONFIG_HOME" ]
+then
+ export XDG_CONFIG_HOME=$HOME/.config
+fi
+
+# assure the relevant directories exist.
+for dir in $XDG_CACHE_HOME/uzbl $XDG_DATA_HOME/uzbl $XDG_CONFIG_HOME/uzbl
+do
+ if [ ! -d $dir ]
+ then
+ if ! mkdir -p $dir
+ then
+ echo "could not create $dir" >&2
+ exit 2
+ fi
+ fi
+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/uzbl/config $XDG_CONFIG_HOME/uzbl/config
+ then
+ echo "Could not copy default config to $XDG_CONFIG_HOME/uzbl/config" >&2
+ exit 3
+ fi
+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 ]
+#then
+ # if you want to customize it, copy to your $XDG_DATA_HOME/uzbl/scripts/ and update $PATH
+ uzbl-cookie-daemon -v start
+#fi
+
+DAEMON_SOCKET=$XDG_CACHE_HOME/uzbl/event_daemon
+DAEMON_PID=${DAEMON_SOCKET}.pid
+
+#if [ -f "$DAEMON_PID" ]
+#then
+ uzbl-event-manager -va start
+#fi
+
+uzbl-core "$@" --connect-socket $DAEMON_SOCKET