]>
Commit | Line | Data |
---|---|---|
189288f7 | 1 | #!/bin/sh |
d9362f34 | 2 | |
9938f1e2 | 3 | if [ 0 -eq 1 ]; then |
4 | alias mkdir="echo mkdir" | |
5 | alias ln="echo ln" | |
6 | alias rm="echo rm" | |
7 | alias cap_mkdb="echo cap_mkdb" | |
8 | alias unlink="echo unlink" | |
9 | fi | |
10 | ||
5b39422d | 11 | #fix permissions from git (TODO: should probably move this to git hook) |
12 | chmod go= base/.zshenv base/.Xresources | |
13 | ||
14 | #create preferred folder structure | |
15 | cd "$HOME" | |
16 | mkdir -p bin etc share .urxvt/ext > /dev/null 2>&1 | |
17 | mkdir -m 700 tmp tmp/vim > /dev/null 2>&1 | |
18 | cd - | |
19 | ||
9938f1e2 | 20 | l() { |
f29cd560 | 21 | # TODO: use install? |
de6b1600 | 22 | [ -L "$1" -o \! -e "$1" ] && ln -sFhvw "${2:-$x}" "$1" |
9938f1e2 | 23 | } |
24 | ||
25 | find "$PWD/base" -depth 1 | while read -r x; do | |
26 | l "$HOME/`basename "$x"`" | |
27 | done | |
de6b1600 | 28 | find bin share -depth 1 | while read -r x; do |
29 | l "$HOME/$x" "$PWD/$x" | |
f29cd560 | 30 | done |
9938f1e2 | 31 | find "$PWD/xdg" -depth 1 | while read -r x; do |
32 | l "${XDG_CONFIG_HOME:-$HOME/.config}/`basename "$x"`" | |
7f0acd88 | 33 | done |
9938f1e2 | 34 | find "$PWD/urxvt-ext" -type f -perm -ugo=x -mindepth 1 -maxdepth 2 | while read -r x; do |
35 | l "$HOME/.urxvt/ext/`basename $x`" | |
805ce2dc | 36 | done |
bd6360b9 | 37 | touch "$HOME/.hushlogin" |
7f0acd88 | 38 | |
39bd5e00 | 39 | #FreeBSD tries `_secure_path' on `.login_conf' before reaading the database, |
40 | #so it needs to be compiled and unlinked for it to actually take effect. | |
d9362f34 | 41 | cd "$HOME" |
39bd5e00 | 42 | rm .login_conf.db |
43 | cap_mkdb .login_conf | |
44 | unlink .login_conf | |
d9362f34 | 45 | cd - |