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