3 #NOTE: .zshenv XDG paths are hardcoded to allow non-zsh install
6 if [ "$1" = "test" ]; then
7 mkdir() { echo -- "$*"; }
10 alias cap_mkdb="echo cap_mkdb"
11 alias unlink="echo unlink"
14 # create preferred folder structure
16 mkdir -p bin etc share share/fonts .urxvt/ext .icons .themes > /dev/null 2>&1
17 mkdir -pm 700 var/tmp var/tmp/vim > /dev/null 2>&1
20 # accomodate multiple userlands
23 if [ -z "$OSTYPE" ]; then
24 OSTYPE=`uname -s | tr '[:upper:]' '[:lower:]'`
27 # TODO: make links safer for systems without -Fw
28 freebsd*) lnargs=-sFhvw;;
29 netbsd|openbsd*) lnargs=-sfhv;;
30 # android busybox find doesn't have -executable
31 android) fex=-executable;;
36 [ -L "$1" -o \! -e "$1" ] && ln $lnargs "${2:-$x}" "$1"
40 find "$PWD/base" -mindepth 1 -maxdepth 1 | while read -r x; do
41 l "$HOME/`basename "$x"`"
43 find bin share -mindepth 1 -maxdepth 1 | while read -r x; do
44 l "$HOME/$x" "$PWD/$x"
46 find "$PWD/xdg" -mindepth 1 -maxdepth 1 | while read -r x; do
47 l "$HOME/etc/`basename "$x"`"
49 find "$PWD/urxvt-ext" -type f $fex -mindepth 1 -maxdepth 2 | while read -r x; do
50 l "$HOME/.urxvt/ext/`basename $x`"
53 for y in icons themes; do
54 find $y -type d -mindepth 2 -maxdepth 2 | while read -r x; do
55 l "$HOME/.$y/`basename "$x"`" "$PWD/$x"
59 find "$PWD/xorg/fonts" -type d -mindepth 1 -maxdepth 1 | while read -r x; do
60 l "$HOME/share/fonts/`basename "$x"`"
64 if [ "$OSTYPE" = "freebsd" ]; then
65 # FreeBSD tries `_secure_path' on `.login_conf' before reading the
66 # database, so it needs to be compiled and unlinked for it to actually
72 # run .zprofile to set up tmp