aboutsummaryrefslogtreecommitdiff
path: root/install
blob: 0dcf09ca1be33017d4c18cee5cb718edb0e02810 (plain)
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/bin/sh

create_dotfile_link()
{
    target="$HOME/$2"
    mkdir -vp "$(dirname "$target")"
    ln -svf "$DOTDIR/$1" "$target"
}

create_dotfile_link_same()
{
    create_dotfile_link "$1" "$1"
}

###############################################################################
# link dotfiles
###############################################################################

# dotfiles directory
[ -z "$DOTDIR" ] && DOTDIR=$(pwd) && export DOTDIR

# Creating links
create_dotfile_link_same .zshrc
create_dotfile_link_same .bashrc
create_dotfile_link_same .vimrc
create_dotfile_link_same .pluggins.vim
create_dotfile_link grep.vim .vim/plugin/grep.vim

create_dotfile_link xmonad.hs .xmonad/xmonad.hs

create_dotfile_link_same .gdbinit
create_dotfile_link_same .ghci
create_dotfile_link_same .gitconfig
create_dotfile_link_same .muttrc
create_dotfile_link_same .mailcap
create_dotfile_link_same .xinitrc
create_dotfile_link_same .zprofile

create_dotfile_link redshift.conf .config/redshift.conf
create_dotfile_link mimeapps.list .config/mimeapps.list
create_dotfile_link applications/sxiv.desktop     .data/applications/sxiv.desktop
create_dotfile_link applications/mutt.desktop     .data/applications/mutt.desktop
create_dotfile_link applications/zathura.desktop  .data/applications/zathura.desktop
create_dotfile_link applications/newsboat.desktop .data/applications/newsboat.desktop

create_dotfile_link dunst/dunstrc .config/dunst/dunstrc

create_dotfile_link_same .newsboat/config
#create_dotfile_link_same .newsboat/urls

# create_dotfile_link_same slock/config.def.h

create_dotfile_link qutebrowser/config.py .config/qutebrowser/config.py

create_dotfile_link_same .moc/config
create_dotfile_link_same .moc/themes/solarized

ln -sv "$DOTDIR/bin" "$HOME/bin"

###############################################################################
# dependencies
###############################################################################

[ "$#" -ne 1 ] || [ ! "$1" = "-a" ] && exit 0
echo "Installing Dependencies"

###############################################################################
# vim Plug
PLUGFILE="$HOME/.vim/autoload/plug.vim"
PLUGURL='https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
[ ! -f "$PLUGFILE" ] && echo "Downloading plug.vim" && \
    curl -fLo "$PLUGFILE" --create-dirs "$PLUGURL"
echo "Installing plug.vim Pluggins"
vim -c "PlugInstall" -c "qa"

###############################################################################
# zsh pluggins

update_plugin()
{
    url="$1"
    dest_path="$2"
    if [ ! -d "$dest_path" ]
    then
        echo "Installing $dest_path"
        git clone "$url" "$dest_path"
    else
        echo "Updating $dest_path"
        git -C "$dest_path" pull
    fi
}

mkdir -p "$HOME/.zsh"
update_plugin 'https://github.com/sindresorhus/pure' "$HOME/.zsh/pure"
update_plugin 'https://github.com/zsh-users/zsh-syntax-highlighting' "$HOME/.zsh/zsh-syntax-highlighting"
update_plugin 'https://github.com/MichaelAquilina/zsh-you-should-use' "$HOME/.zsh/zsh-you-should-use"