]> git.sev.monster Git - dotfiles.git/blame - install.sh
fixed zsh, renamed l -> lck, netbsd support
[dotfiles.git] / install.sh
CommitLineData
1b8a4102 1#!/bin/sh
03bc64c4 2
7f359c8a 3if [ 0 -eq 1 ]; then
d877aef2 4 mkdir() { echo "$*"; }
7f359c8a 5 alias ln="echo ln"
6 alias rm="echo rm"
7 alias cap_mkdb="echo cap_mkdb"
8 alias unlink="echo unlink"
9fi
10
1873e725 11#create preferred folder structure
d877aef2 12cd ~
1873e725 13mkdir -p bin etc share .urxvt/ext > /dev/null 2>&1
14mkdir -m 700 tmp tmp/vim > /dev/null 2>&1
15cd -
16
cf9ecb6f 17#accomodate linuxisms
18fex='-perm -ugo=x'
d877aef2 19case "$OSTYPE" in
20 # TODO: make links safer for systems without -Fw
21 freebsd) lnargs=-sFhvw;;
22 netbsd|openbsd) lnargs=-sfhv;;
23 *) lnargs=-sfnv
24 #android busybox find doesn't have -executable
25 #and its sh doesn't set OSTYPE :DD
26 if [ -z "$ANDROID_ROOT" ]; then
27 fex=-executable
28 fi;;
cf9ecb6f 29esac
30
7f359c8a 31l() {
1390d028 32 # TODO: use install?
cf9ecb6f 33 [ -L "$1" -o \! -e "$1" ] && ln $lnargs "${2:-$x}" "$1"
7f359c8a 34}
35
d877aef2 36find "$PWD/base" -mindepth 1 -maxdepth 1 | while read -r x; do
7f359c8a 37 l "$HOME/`basename "$x"`"
38done
d877aef2 39find bin share -mindepth 1 -maxdepth 1 | while read -r x; do
a58ad2f0 40 l "$HOME/$x" "$PWD/$x"
1390d028 41done
d877aef2 42find "$PWD/xdg" -mindepth 1 -maxdepth 1 | while read -r x; do
cf9ecb6f 43 l "${XDG_CONFIG_HOME:-$HOME/etc}/`basename "$x"`"
04ff96a4 44done
cf9ecb6f 45find "$PWD/urxvt-ext" -type f $fex -mindepth 1 -maxdepth 2 | while read -r x; do
7f359c8a 46 l "$HOME/.urxvt/ext/`basename $x`"
82151901 47done
04ff96a4 48
cf9ecb6f 49cd ~
d877aef2 50if [ "$OSTYPE" = "freebsd" ]; then
cf9ecb6f 51 touch .hushlogin
52
53 #FreeBSD tries `_secure_path' on `.login_conf' before reading the database,
54 #so it needs to be compiled and unlinked for it to actually take effect.
55 rm .login_conf.db
56 cap_mkdb .login_conf
57fi
ee4bf66d 58unlink .login_conf
03bc64c4 59cd -
This page took 0.039602 seconds and 4 git commands to generate.