~charles/dotfiles

ref: f2b0d150e08f193450b7f61acd36aafa1aee8e04 dotfiles/install.sh -rwxr-xr-x 2.1 KiB
f2b0d150Charles Daniels add lstodo 2 years ago
                                                                                
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
#!/bin/sh

check_prog() {
	if [ ! -x "$(which "$1")" ] ; then
		echo "ERROR: could not find '$1' in PATH" 1>&2
		exit 1
	fi
}

set -u

check_prog curl

# install overlay
cd "$(dirname "$0")"
DOTFILES_DIR="$(pwd)"
OVERLAY_DIR="$DOTFILES_DIR/overlay"
DEST_DIR="$HOME"

cd "$OVERLAY_DIR"

find . -type f | while read -r target ; do
	target_relparent="$(dirname "$target")"
	dest_parent="$DEST_DIR/$target_relparent"
	dest_file="$DEST_DIR/$target"
	rm -f "$dest_file"
	mkdir -p "$dest_parent"
	cp "$target" "$dest_file"
done

# setup gitconfig
git_username="$(git config --get user.name)"
git_email="$(git config --get user.email)"
git_config_file="$HOME/.gitconfig"
rm -f "$git_config_file"
echo '[user]' >> "$git_config_file"
echo "    name = $git_username" >> "$git_config_file"
echo "    email = $git_email" >> "$git_config_file"
echo "" >> "$git_config_file"
cat "$DOTFILES_DIR/gitconfig" >> "$git_config_file"

# install fastabr
make -C "$DOTFILES_DIR/fastabr" fastabr
cp "$DOTFILES_DIR/fastabr/fastabr" ~/bin/fastabr

xrdb merge ~/.Xresources

# vim-plug
curl -SsfLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs \
    https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
curl -SsfLo ~/.vim/autoload/plug.vim --create-dirs \
    https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim

# zsh-history-substring-search
curl -SsfLo ~/.zsh/zsh-history-substring-search.zsh --create-dirs \
    https://github.com/zsh-users/zsh-history-substring-search/raw/v1.0.1/zsh-history-substring-search.zsh

# zsh git completions
curl -SsfLo ~/.zsh/completions/git-completion.zsh --create-dirs \
    https://github.com/git/git/raw/v2.20.1/contrib/completion/git-completion.zsh

# zsh docker completions
curl -SsfLo ~/.zsh/completions/_docker-compose https://raw.githubusercontent.com/docker/compose/1.23.2/contrib/completion/zsh/_docker-compose 

# xfce4 gruvbox theme
mkdir -p ~/.local/share/xfce4/terminal/colorschemes
curl -SsfLo ~/.local/share/xfce4/terminal/colorschemes/gruvbox-dark.theme 'https://raw.githubusercontent.com/morhetz/gruvbox-contrib/master/xfce4-terminal/gruvbox-dark.theme'

exit 0