aboutsummaryrefslogtreecommitdiffhomepage
path: root/misc/env.sh
blob: 4eec5255b9cfa3a9567b0df094c5ebfd1476413a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh
# This script is copied in to the sandbox/ directory during any sandbox make
# target and is used to create an isolated environment for uzbl-core,
# uzbl-browser and uzbl-tabbed to be run and tested.

# It would be better to use something more flexible like $(dirname $0) but I
# couldn't get to work nicely from the Makefile:
#  - Sourcing file gives $0 == /bin/sh
#  - Executing limits scope of variables too much (even with exporting)
# Maybe we should spawn processes from here with an 'exec' at the end?

# Re-define our home location inside the sandbox dir.
export HOME=./sandbox/home

# Export default XDG_{DATA,CACHE,..}_HOME locations inside the sandbox
# directory according to defaults in the xdg specification.
# <http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html>
export XDG_DATA_HOME=$HOME/.local/share
export XDG_CACHE_HOME=$HOME/.cache
export XDG_CONFIG_HOME=$HOME/.config

# Now update the path to include our sandbox bin directory.
export PATH="./sandbox/usr/local/bin:$PATH"