aboutsummaryrefslogtreecommitdiff
path: root/install
blob: 05f8bbf43146e7d4e13ed6c580080c3f219ab0a0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/usr/bin/env bash

# Define dotfiles directory and check it exists
dotfiles=$HOME/.dotfiles
if [[ ! -d $dotfiles ]]; then
    printf 'Could not find %s!\n' "$dotfiles" >&2
    exit 1
fi

# Check out submodules
(cd -- "$dotfiles" && git submodule update --init)

# Create a binaries directory
mkdir -p -- "$HOME"/.local/bin

# Link in essential logical binaries
ln -insv -- "$dotfiles"/ack/ack "$HOME"/.local/bin

# Link in essential configuration files
ln -insv -- "$dotfiles"/ack/ackrc         "$HOME"/.ackrc
ln -insv -- "$dotfiles"/bash/bash_logout  "$HOME"/.bash_logout
ln -insv -- "$dotfiles"/bash/bash_profile "$HOME"/.bash_profile
ln -insv -- "$dotfiles"/bash/bashrc       "$HOME"/.bashrc
ln -insv -- "$dotfiles"/bash/bashrc.d     "$HOME"/.bashrc.d
ln -insv -- "$dotfiles"/curl/curlrc       "$HOME"/.curlrc
ln -insv -- "$dotfiles"/git/gitconfig     "$HOME"/.gitconfig
ln -insv -- "$dotfiles"/readline/inputrc  "$HOME"/.inputrc
ln -insv -- "$dotfiles"/sh/profile        "$HOME"/.profile
ln -insv -- "$dotfiles"/sh/profile.d      "$HOME"/.profile.d
ln -insv -- "$dotfiles"/terminfo          "$HOME"/.terminfo
ln -insv -- "$dotfiles"/vim/vimrc         "$HOME"/.vimrc
ln -insv -- "$dotfiles"/vim               "$HOME"/.vim

# Link in shell stuff
while getopts :gmntx opt; do
    case $opt in
        g)
            mkdir -pv -- "$HOME"/.gnupg
            ln -insv -- "$dotfiles"/gnupg/gpg.conf       "$HOME"/.gnupg
            ln -insv -- "$dotfiles"/gnupg/gpg-agent.conf "$HOME"/.gnupg
            ;;
        m)
            ln -insv -- "$dotfiles"/mutt/muttrc "$HOME"/.muttrc
            ln -insv -- "$dotfiles"/mutt        "$HOME"/.mutt
            ;;
        n)
            mkdir -pv -- "$HOME"/.config "$HOME"/.local/share/newsbeuter
            ln -insv -- "$dotfiles"/newsbeuter "$HOME"/.config
            ;;
        t)
            ln -insv -- "$dotfiles"/tmux/tmux.conf "$HOME"/.tmux.conf
            ;;
        x)
            mkdir -pv -- "$HOME"/.config
            ln -insv -- "$dotfiles"/X/Xmodmap    "$HOME"/.Xmodmap
            ln -insv -- "$dotfiles"/X/Xresources "$HOME"/.Xresources
            ln -insv -- "$dotfiles"/X/xsession   "$HOME"/.xsession
            ln -insv -- "$dotfiles"/X/xsessionrc "$HOME"/.xsessionrc
            ln -insv -- "$dotfiles"/vim/gvimrc   "$HOME"/.gvimrc
            ln -insv -- "$dotfiles"/awesome      "$HOME"/.config/awesome
            ;;
    esac
done
shift $((OPTIND-1))