-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·123 lines (108 loc) · 2.48 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·123 lines (108 loc) · 2.48 KB
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#!/bin/bash
# =====================================
# dotkula Install Script (install.sh)
# Author: Aubhro Sengupta (lorddarkula)
# Email: hello@aubhro.com
# Website: https://aubhro.me
# =====================================
# Options: --bash, --dev, --term
# Path Variables
# --------------
# Path to dotkula
REPO_DIR=$(pwd)
# Path to .config
CONFIG_DIR="$HOME/.config"
# Helper Functions
# ----------------
# Links configuration file to proper location
# Argumens:
# $1 - path of symlink to create
# $2 - path of file in git repo
create_link() {
if [ -f "$1" ]; then
echo "File $1 exists"
echo "Moving $1 to $1.old"
mv "$1" "$1.old"
fi
ln "$2" "$1"
}
install_bash() {
create_link "$HOME/.bash_profile" "$REPO_DIR/bash/.bash_profile"
create_link "$HOME/.bashrc" "$REPO_DIR/bash/.bashrc"
create_link "$HOME/.inputrc" "$REPO_DIR/bash/.inputrc"
echo "Bash config files installed"
}
install_zsh() {
create_link "$HOME/.zshrc" "$REPO_DIR/zsh/.zshrc"
create_link "$HOME/.zprofile" "$REPO_DIR/zsh/.zprofile"
echo "Zsh config files installed"
}
install_vim() {
create_link "$HOME/.vimrc" "$REPO_DIR/vim/.vimrc"
echo "Vim config installed"
}
install_nvim() {
# install neovim
mkdir -p "$CONFIG_DIR/nvim"
create_link "$CONFIG_DIR/nvim/init.vim" "$REPO_DIR/nvim/init.vim"
echo "NeoVim config installed"
}
install_tmux() {
create_link "$HOME/.tmux.conf" "$REPO_DIR/tmux/.tmux.conf"
echo "Tmux conf installed"
}
install_alacritty() {
mkdir -p "$CONFIG_DIR/alacritty"
create_link "$CONFIG_DIR/alacritty/alacritty.yml" "$REPO_DIR/alacritty/alacritty.yml"
echo "Alacritty yml installed"
}
install_zathura() {
mkdir -p "$CONFIG_DIR/zathura"
create_link "$CONFIG_DIR/zathura/zathurarc" "$REPO_DIR/zathura/zathurarc"
echo "Zathura rc installed"
}
install_ranger() {
mkdir -p "$CONFIG_DIR/ranger"
create_link "$CONFIG_DIR/ranger/rc.conf" "$REPO_DIR/ranger/rc.conf"
create_link "$CONFIG_DIR/ranger/rifle.conf" "$REPO_DIR/ranger/rifle.conf"
create_link "$CONFIG_DIR/ranger/scope.sh" "$REPO_DIR/ranger/scope.sh"
echo "Ranger config installed"
}
for INSTALL_TYPE in "$@"; do
case "$INSTALL_TYPE" in
ssh)
install_bash
install_vim
install_tmux
;;
all)
install_bash
install_tmux
install_vim
install_nvim
install_alacritty
install_zathura
;;
bash)
install_bash
;;
vim)
install_vim
;;
nvim)
install_nvim
;;
tmux)
install_tmux
;;
zsh)
install_zsh
;;
alacritty)
install_alacritty
;;
zathura)
install_zathura
;;
esac
done