]> git.sev.monster Git - dotfiles.git/blame - install.sh
fix TERM and add DVTM_TERM
[dotfiles.git] / install.sh
CommitLineData
189288f7 1#!/bin/sh
d9362f34 2
1f8bf106 3# test
9938f1e2 4if [ 0 -eq 1 ]; then
5 alias mkdir="echo mkdir"
6 alias ln="echo ln"
7 alias rm="echo rm"
8 alias cap_mkdb="echo cap_mkdb"
9 alias unlink="echo unlink"
10fi
11
1f8bf106 12# accomodate linuxisms
138de127 13fex='-perm -ugo=x'
364338b5 14# TODO: should probably do this better
15case "`uname`" in
16 *BSD*) lnargs=-sFhvw
138de127 17 d1='-depth 1'
18 bsd=yes;;
19 *) lnargs=-sfnv
20 d1='-mindepth 1 -maxdepth 1'
1f8bf106 21 # android busybox find doesn't have -execute
22 # and its sh doesn't set OSTYPE :DD
138de127 23 if [ -z "$ANDROID_ROOT" ]; then
24 fex=-executable
25 fi;;
26esac
27
9938f1e2 28l() {
f29cd560 29 # TODO: use install?
138de127 30 [ -L "$1" -o \! -e "$1" ] && ln $lnargs "${2:-$x}" "$1"
9938f1e2 31}
32
1f8bf106 33
34# create preferred folder structure
35cd ~
36mkdir -p bin etc share var/run var/log urxvt/ext > /dev/null 2>&1
8aa18f0e 37mkdir -m 700 var/tmp var/tmp/vim > /dev/null 2>&1
f2b262d5 38[ -z "$bsd" ] && mkdir -m 700 tmp > /dev/null 2>&1
1f8bf106 39cd -
40
41# link files
138de127 42find "$PWD/base" $d1 | while read -r x; do
9938f1e2 43 l "$HOME/`basename "$x"`"
44done
138de127 45find bin share $d1 | while read -r x; do
de6b1600 46 l "$HOME/$x" "$PWD/$x"
f29cd560 47done
138de127 48find "$PWD/xdg" $d1 | while read -r x; do
49 l "${XDG_CONFIG_HOME:-$HOME/etc}/`basename "$x"`"
7f0acd88 50done
138de127 51find "$PWD/urxvt-ext" -type f $fex -mindepth 1 -maxdepth 2 | while read -r x; do
9938f1e2 52 l "$HOME/.urxvt/ext/`basename $x`"
805ce2dc 53done
7f0acd88 54
138de127 55cd ~
56if [ -n "$bsd" ]; then
57 touch .hushlogin
58
1f8bf106 59 # FreeBSD tries `_secure_path' on `.login_conf' before reading the
60 # database, so it needs to be compiled and unlinked for it to actually
61 # take effect.
138de127 62 rm .login_conf.db
63 cap_mkdb .login_conf
1f8bf106 64
65 # run .zprofile to set up tmp
66 /usr/local/bin/zsh .zprofile
138de127 67fi
39bd5e00 68unlink .login_conf
d9362f34 69cd -
This page took 0.045526 seconds and 4 git commands to generate.