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 \
25 .icons .themes .gnupg .ssh .termux >$devnull 2>&1
26 mkdir -pm 700 var/tmp var/tmp/vim >$devnull 2>&1
30 if [ -z "$OSTYPE" ]; then
31 OSTYPE=`uname -s | tr '[:upper:]' '[:lower:]'`
34 # accomodate multiple userlands
37 freebsd*) lnargs=-sFhv;;
38 netbsd|openbsd*) lnargs=-sfhv;;
43 [ -L "$1" -o \! -e "$1" ] && ln $lnargs "${2:-$PWD/$x}" "$1" || \
44 echo "!!! File exists and is not a link: $1"
48 find base -mindepth 1 -maxdepth 1 | while read -r x; do
49 l "$HOME/`basename "$x"`"
51 find bin share -mindepth 1 -maxdepth 1 | while read -r x; do
54 find fonts -mindepth 1 -maxdepth 1 -type d | while read -r x; do
55 l "$HOME/share/fonts/`basename "$x"`"
57 find xdg -mindepth 1 -maxdepth 1 | while read -r x; do
58 l "$HOME/etc/`basename "$x"`"
60 find urxvt-ext -mindepth 1 -maxdepth 2 -type f -perm -111 | while read -r x; do
61 l "$HOME/.urxvt/ext/`basename $x`"
63 find xorg/icons -mindepth 1 -maxdepth 2 -type d | while read -r x; do
64 if [ -e "$x/index.theme" ]; then
65 d="$HOME/.icons/`basename "$x"`"
67 which gtk-update-icon-cache >/dev/null 2>&1 && gtk-update-icon-cache -qtf $d
71 find xorg/themes -mindepth 1 -maxdepth 1 -type d | while read -r x; do
72 l "$HOME/.themes/`basename "$x"`"
74 find gpg -mindepth 1 -maxdepth 1 \! -name '*.gpg' | while read -r x; do
75 l "$HOME/.gnupg/`basename "$x"`"
77 if which gpg >/dev/null 2>&1; then
78 find gpg -mindepth 1 -maxdepth 1 -name '*.gpg' | while read -r x; do
82 for y in ssh termux; do
83 find $y -mindepth 1 -maxdepth 1 | while read -r x; do
84 l "$HOME/.$y/`basename "$x"`"