]> git.sev.monster Git - dotfiles.git/blame - install.sh
remove temp file
[dotfiles.git] / install.sh
CommitLineData
189288f7 1#!/bin/sh
d9362f34 2
7197cc5c 3#NOTE: .zshenv XDG paths are hardcoded to allow non-zsh install
4
1f8bf106 5# test
7197cc5c 6if [ "$1" = "test" ]; then
a568f7fa 7 mkdir() { echo -- "$@"; }
9938f1e2 8 alias ln="echo ln"
9 alias rm="echo rm"
10 alias cap_mkdb="echo cap_mkdb"
11 alias unlink="echo unlink"
12fi
13
fef6b2b5 14# create preferred folder structure
ba63cd01 15cd ~
7197cc5c 16mkdir -p bin etc share share/fonts .urxvt/ext .icons .themes > /dev/null 2>&1
f7960c69 17mkdir -pm 700 var/tmp var/tmp/vim > /dev/null 2>&1
5b39422d 18cd -
19
a568f7fa 20# ensure ostype
3daa445f 21if [ -z "$OSTYPE" ]; then
f7960c69 22 OSTYPE=`uname -s | tr '[:upper:]' '[:lower:]'`
3daa445f 23fi
a568f7fa 24
25# accomodate multiple userlands
26lnargs=-sfnv
ba63cd01 27case "$OSTYPE" in
28 # TODO: make links safer for systems without -Fw
08660cec 29 freebsd*) lnargs=-sFhvw;;
7197cc5c 30 netbsd|openbsd*) lnargs=-sfhv;;
138de127 31esac
32
9938f1e2 33l() {
f29cd560 34 # TODO: use install?
138de127 35 [ -L "$1" -o \! -e "$1" ] && ln $lnargs "${2:-$x}" "$1"
9938f1e2 36}
37
1f8bf106 38# link files
ba63cd01 39find "$PWD/base" -mindepth 1 -maxdepth 1 | while read -r x; do
9938f1e2 40 l "$HOME/`basename "$x"`"
41done
ba63cd01 42find bin share -mindepth 1 -maxdepth 1 | while read -r x; do
de6b1600 43 l "$HOME/$x" "$PWD/$x"
f29cd560 44done
ba63cd01 45find "$PWD/xdg" -mindepth 1 -maxdepth 1 | while read -r x; do
7197cc5c 46 l "$HOME/etc/`basename "$x"`"
7f0acd88 47done
a568f7fa 48find "$PWD/urxvt-ext" -type f -perm -111 -mindepth 1 -maxdepth 2 | while read -r x; do
9938f1e2 49 l "$HOME/.urxvt/ext/`basename $x`"
805ce2dc 50done
a568f7fa 51find "$PWD/xorg/icons" -type d -mindepth 1 -maxdepth 2 | while read -r x; do
52 if [ -e "$x/index.theme" ]; then
53 l "$HOME/.icons/`basename "$x"`"
54 fi
90595fd4 55done
56find "$PWD/xorg/themes" -type d -mindepth 1 -maxdepth 1 | while read -r x; do
57 l "$HOME/.themes/`basename "$x"`"
7197cc5c 58done
7197cc5c 59find "$PWD/xorg/fonts" -type d -mindepth 1 -maxdepth 1 | while read -r x; do
60 l "$HOME/share/fonts/`basename "$x"`"
f7960c69 61done
7f0acd88 62
fef6b2b5 63# run .zprofile to set up tmp
a568f7fa 64zsh ~/.zprofile
This page took 0.054241 seconds and 4 git commands to generate.