3 #NOTE: .zshenv XDG paths are hardcoded to allow non-zsh install
7 if [ "$1" = "test" ]; then
8 echo "Running test -- no changes will be applied"
16 alias mkdir="echo mkdir"
22 # create preferred folder structure
24 mkdir -p bin etc share share/fonts .urxvt/ext .icons .themes >$devnull 2>&1
25 mkdir -pm 700 var/tmp var/tmp/vim >$devnull 2>&1
29 if [ -z "$OSTYPE" ]; then
30 OSTYPE=`uname -s | tr '[:upper:]' '[:lower:]'`
33 # accomodate multiple userlands
36 freebsd*) lnargs=-sFhv;;
37 netbsd|openbsd*) lnargs=-sfhv;;
42 [ -L "$1" -o \! -e "$1" ] && ln $lnargs "${2:-$PWD/$x}" "$1" || \
43 echo "!!! File exists and is not a link: $1"
47 find base -mindepth 1 -maxdepth 1 | while read -r x; do
48 l "$HOME/`basename "$x"`"
50 # requires existing source tree and `make dabuild`
51 x="$HOME/src/docker-abuild/dabuild"
53 l "$HOME/bin/`basename "$x"`" "$x"
55 find bin share -mindepth 1 -maxdepth 1 | while read -r x; do
58 find xdg -mindepth 1 -maxdepth 1 | while read -r x; do
59 l "$HOME/etc/`basename "$x"`"
61 find urxvt-ext -mindepth 1 -maxdepth 2 -type f -perm -111 | while read -r x; do
62 l "$HOME/.urxvt/ext/`basename $x`"
64 find xorg/icons -mindepth 1 -maxdepth 2 -type d | while read -r x; do
65 if [ -e "$x/index.theme" ]; then
66 d="$HOME/.icons/`basename "$x"`"
68 which gtk-update-icon-cache >/dev/null 2>&1 && gtk-update-icon-cache -qtf $d
72 find xorg/themes -mindepth 1 -maxdepth 1 -type d | while read -r x; do
73 l "$HOME/.themes/`basename "$x"`"
75 find fonts -mindepth 1 -maxdepth 1 -type d | while read -r x; do
76 l "$HOME/share/fonts/`basename "$x"`"
78 #XXX: potential bug with newlines in profile name (if ff even takes it)
79 #XXX: only uses first profile folder, read from profiles.ini
80 ffdir="`find "$HOME/.mozilla/firefox" -mindepth 1 -maxdepth 1 -type d | head -1 2>$devnull`"
81 if [ -d "$ffdir" ]; then
82 find firefox -mindepth 1 -maxdepth 1 | while read -r x; do
83 l "$ffdir/`basename "$x"`"
86 echo "Updating user.js"
87 sh ./user-js-updater.sh
91 # run .zprofile to set up tmp
92 # .zprofile also sources .zshenv for compatibility